User-aided image segmentation

ABSTRACT

Some embodiments provide a program that provides a graphical user interface (GUI). The GUI includes a display area for displaying an image that includes several pixels. Each pixel includes a set of pixel values in a three-dimensional color space. The GUI includes a first selectable GUI item for activating a color masking tool (1) for selecting a set of pixels in the image and (2) for defining a three-dimensional volume to encompass the pixel values of the set of pixels in the three-dimensional color space. The three-dimensional volume serves as an approximation of a rectangular cuboid that has at least one rounded corner. The GUI includes a second selectable GUI item for applying a color correction operation to the image by modifying pixels in the image that have pixel values encompassed by the three-dimensional volume in the three-dimensional color space.

CLAIM OF BENEFIT TO PRIOR APPLICATIONS

This application claims the benefit of U.S. Provisional PatentApplication 61/443,708, filed Feb. 16, 2011, U.S. Provisional PatentApplication 61/443,718, filed Feb. 16, 2011, and U.S. Provisional PatentApplication 61/443,730, filed Feb. 17, 2011. The contents of U.S.Provisional Patent Application 61/443,708, filed Feb. 16, 2011 arehereby incorporated by reference.

CROSS REFERENCE TO RELATED APPLICATIONS

This Application is related to the following applications: U.S. patentapplication Ser. No. 13/134,280, filed Jun. 3, 2011, now published asU.S. Patent Publication 2012/0206475; U.S. patent application Ser. No.13/134,289, filed Jun. 3, 2011, now issued as U.S. Patent No. 8,823,726;U.S. patent application Ser. No. 13/134,313, filed Jun. 3, 2011, nowissued as U.S. Patent No. 8,760,464; and U.S. patent application Ser.No. 13/134,319 filed Jun. 3, 2011, now published as U.S. PatentPublication 2012/0210229.

BACKGROUND

When editing a video clip, many different operations may be performed tothe video clip. For example, a frame (or frames) of the video clip maybe modified in order to achieve a particular appearance, look, or feel.One of the many ways to modify the frame of the video clip is to modifythe colors of the frame. Sometimes a user (e.g., an editor, colorist)may wish to modify the colors of the entire frame of the video clip.However, the user may also wish to modify the colors of only a portionof the frame of the video clip.

Many different video editing tools exist for identifying a portion ofthe frame that is going to be modified. For instance, some video editingtools allow the user to specify a particular range(s) of colorattributes (e.g., luminance, saturation, hues, etc.) in order toidentify a portion of the frame to modify the colors of the portion ofthe frame. Some video editing tools even allow the user to use geometricshapes to specify a particular area of the frame in order to identify aportion of the frame to modify the colors of the portion of the frame.

BRIEF SUMMARY

Some embodiments of the invention provide a novel masking tool for amedia-editing application. The masking tool of some embodimentsidentifies a portion of an image (e.g., a still image, a frame or fieldof a video clip, etc.) to which a color correction operation (e.g., hueadjustments, saturation adjustments, brightness adjustments, etc.) isapplied. These color correction operations are also referred to assecondary color correction operations. Different embodiments of themasking tool identify a portion of an image differently. For instance,some embodiments provide a novel color-based masking tool (also referredto as a color masking tool). The color masking tool of some embodimentsidentifies a portion of an image based on the colors in the image (i.e.,the color values of pixels in the image). Alternatively, or inconjunction with the color-based masking tool, some embodiments providea novel spatial-based masking tool (also referred to as a shape maskingtool). The shape masking tool of some embodiments identifies a portionof an image based on a spatial region in the image (i.e., the locationof pixels in the image).

As mentioned above, some embodiments of the invention provide a novelcolor masking tool for a media-editing application. The color maskingtool of some embodiments defines a first portion of a three-dimensionalcolor space based on a selection (e.g., received from a user through aGraphical User Interface (“GUI”) of the media-editing application) of afirst portion of an image. In some embodiments, the first portion of thethree-dimensional color space is a superellipse-based shape (e.g., asuper-ellipsoid or superellipsoid) that includes pixel values in thethree-dimensional color space of pixels in the first portion of theimage. In some embodiments, the three-dimensional color space is an RGB(red, green, blue) color space.

Based on the first portion of the image, the color masking tool of someembodiments defines a color mask. In some embodiments, a color maskspecifies pixels in the image that have pixel values included in (i.e.,inside) the defined first portion of the three-dimensional color space.In other words, the color mask specifies pixels in the image that havethe same or similar pixel values as the pixel values of the pixels inthe first portion of the image. In some embodiments, the first portionof the three-dimensional color space is a representation of the colormask in the three-dimensional color space. The color masking tool ofsome embodiments applies color correction operations (e.g., invoked by auser through selection of a GUI item provided by the media-editingapplication) to a portion or region of the image (also referred to assecondary color corrections) by using the color mask to isolate pixelsin the image that have particular color values and applying colorcorrection operations (e.g., hue adjustments, saturation adjustments,brightness adjustments, etc.) to the isolated pixels.

As mentioned above, some embodiments of the color masking tool definethe first portion of the three-dimensional color space as asuperellipse-based shape (e.g., a super-ellipsoid or superellipsoid)that includes pixel values in the three-dimensional color space ofpixels in the first portion of the image. To determine the firstportion, some embodiments identify a first rectangular cuboid in thethree-dimensional color space that encompasses pixel values in thethree-dimensional color space of pixels in the first portion of theimage (also referred to as a bounding box).

In some embodiments, the color masking tool performs Principal ComponentAnalysis (PCA) to the pixel values in the three-dimensional color spaceof the pixels in the first portion of the image. The PCA identifiesthree orthogonal axes (e.g., x-, y-, and z-axis) for determining theorientation of the first rectangular cuboid in the three-dimensionalcolor space. In addition, the PCA identifies a set of transforms (e.g.,a set of matrices) for converting pixel values from thethree-dimensional color space to a coordinate system (also referred toas a Bounding Color Sample (BCS) coordinate system) in which the colormasking tool of some embodiments defines the first rectangular cuboid.

After performing PCA to the pixel values in the three-dimensional colorspace of the pixels in the first portion of the image, the color maskingtool of some embodiments uses the set of transforms to convert thosepixel values from the three-dimensional color space to correspondingpixel values in the BCS coordinate system. Based on the pixel values inthe BCS coordinate system, some embodiments of the color masking toolidentify the boundaries of the first rectangular cuboid (e.g., theminimum and maximum pixel values along each axis). The color maskingtool defines the faces (i.e., sides) of the first rectangular cuboidbased on the identified boundaries. In this manner, the color maskingtool defines a rectangular cuboid that encompasses the pixel values inthe BCS coordinate system of the pixels in the first portion of theimage.

Once the faces of the first rectangular cuboid are defined, someembodiments of the color masking tool center the axes of the BCScoordinate system in the middle of the first rectangular cuboid. In someembodiments, the axes of the BCS coordinate system are centered bytranslating the origin of the BCS coordinate system to the middle of thefirst rectangular cuboid. Moreover, the color masking tool of someembodiments scales the axes of the coordinate system so that the facesof the first rectangular cuboid along each axis correspond to particularvalues (e.g., −1 and 1).

Based on the centered and scaled rectangular cuboid (which is now acuboid) in the BCS coordinate system, some embodiments of the colormasking tool define a superellipse-based shape in the BCS coordinatesystem. The color masking tool uses the faces of the first rectangularcuboid as the boundaries of the superellipse-based shape. Differentembodiments use different superellipse-based shapes defined by differentequations. For instance, some embodiments use a pure ellipsoid whileother embodiments use a superellipsoid that is similar to a cube exceptthe corners (i.e., vertices) are rounded. In some embodiments, the colormasking tool scales the defined superellipse-based shape by a predefinedamount to prevent pixel values near the corners from being cut off bythe defined superellipse-based shape.

When the color masking tool defines a superellipse-based shape in theBCS coordinate system, some embodiments of the color masking toolidentify a set of transforms (e.g., a set of matrices) for convertingpixel values from the BCS coordinate system to corresponding pixelvalues in the three-dimensional color space. In this way, the colormasking tool can identify the corresponding superellipse-based shape inthree-dimensional color space based on the superellipse-based shapedefined in the BCS coordinate system.

As mentioned above, some embodiments of the color masking tool define acolor mask that specifies pixels in the image that have pixel valuesincluded in the first portion of the three-dimensional color space. Insome embodiments, the color masking tool defines a color mask byconverting the pixel values of each pixel in the image to correspondingpixel values in the BCS coordinate system and determining whether thepixel values in the BCS coordinate system are included (i.e., inside) inthe superellipse-based shape defined in the BCS coordinate system. Insome embodiments, pixels in the image that have pixel values within thesuperellipse-based shape are specified as being included in the colormask and pixels in the image that have pixel values outside thesuperellipse-based shape are not specified as being included in thecolor mask.

In some embodiments, the color masking tool modifies the first portionof the three-dimensional color space based on a second selection of asecond portion of the image. The color masking tool of some embodimentsdefines a second portion of the three-dimensional color space thatincludes pixel values in the three-dimensional color space of pixels inthe second portion of the image. Based on the second portion of thethree-dimensional color space, some embodiments of the color maskingtool modify the first portion of the three-dimensional color space toexclude the second portion of the three-dimensional color space. In someembodiments, the modified first portion of the three-dimensional colorspace is a superellipse-based shape that includes pixel values in thethree-dimensional color space of pixels in the second selected portionof the image but excludes pixel values in the three-dimensional colorspace of pixels in the second selected portion of the image. Instead ofmodifying the first portion of the three-dimensional color space, someembodiments define a new portion of the three-dimensional color spacethat includes pixel values in the three-dimensional color space ofpixels in the second selected portion of the image but excludes pixelvalues in the three-dimensional color space of pixels in the secondselected portion of the image.

To determine the modified first portion of the three-dimensional colorspace, some embodiments identify a second rectangular cuboid thatencompasses pixel values in the three-dimensional color space of pixelsin the second portion of the image in a similar manner as describedabove for identifying the first rectangular cuboid that encompassespixel values in the three-dimensional color space of pixels in the firstportion of the image. Based on the first and second rectangular cuboids,the color masking tool identifies a set of rectangular cuboids that eachis a portion of the first rectangular cuboid that includes a face of thefirst rectangular cuboid and does not intersect the second rectangularcuboid in the three-dimensional color space. In some embodiments, therectangular cuboid in the identified set of rectangular cuboids with thelargest volume is determined to be the modified first portion of thethree-dimensional color space.

Some embodiments of the color masking tool identify the set ofrectangular cuboids noted above by using a triangle-triangle collision(or hit) detection technique that, in some embodiments, determineswhether two triangles, given the triangles' coordinates in athree-dimensional space, intersect in the three-dimensional space. Forinstance, the color masking tool uses the triangle-triangle collisiondetection technique to determine whether a particular portion of thefirst rectangular cuboid intersects the second rectangular cuboid in thethree-dimensional color space. Using this technique, the color maskingtool can identify portions of the first rectangular cuboid that includesa face of the first rectangular cuboid and does not intersect the secondrectangular cuboid in the three-dimensional color space.

In some embodiments, the color masking tool defines an offset portion ofthe three-dimensional color space (e.g., a transition region) thatencompasses, but does not include, the first portion (or modified firstportion) of the three-dimensional color space. The offset portion ofsome embodiments is a scaled version of the first portion (or modifiedfirst portion) of the three-dimensional color space. In someembodiments, the offset portion is scaled such that, for each point onthe surface of the offset portion, a distance from the point on thesurface of the offset portion to a corresponding point on the surface ofthe first portion (or modified first portion) is the same or similardistance.

Some embodiments indicate pixels in the image whose pixel values arewithin the first portion (or modified first portion) of thethree-dimensional color space as fully selected pixels, and indicatepixels in the image whose pixel values are within the second portion ofthe three-dimensional color space (which are not within the firstportion of the three-dimensional color space) as partially selectedpixels. When color correction operations are applied to the image, thecolor correction operation is fully applied to pixels that are fullyselected, and the color correction operation is partially applied topixels that are partially selected, in some embodiments. In this manner,partially selected pixels provide a smooth transition between pixels inthe image to which the color correction operation is applied and pixelsin the image to which the color correction operation is not applied.

As mentioned above, some embodiments of the invention provide a novelshape masking tool for a media-editing application. The shape maskingtool of some embodiments provides a shape mask for identifying a regionin an image. In some embodiments, a shape mask is a manipulatabletwo-dimensional shape that is displayed over the image in order toidentify the region in the image that is within the two-dimensionalshape. In other words, the shape mask is for identifying pixels in theimage that are located within the two-dimensional shape. Someembodiments of the shape masking tool apply color correction operations(e.g., invoked by a user through selection of a GUI item provided by themedia-editing application) to the region in the image by using the shapemask to isolate pixels in the image that are located within the shapemask and applying color correction operations (e.g., hue adjustments,saturation adjustments, brightness adjustments, etc.) to the isolatedpixels.

The shape masking tool of some embodiments allows a user of the shapemasking tool to manipulate the shape mask into a plethora of differentshapes and sizes. This way, the user may use a single masking tool toidentify a variety of different regions (e.g., faces, buildings, people,etc.) of different shapes and sizes in an image. Different embodimentsof the shape masking tool allow the user to manipulate the shape mask indifferent ways. For instance, some embodiments allow the user to adjustthe shape of a shape mask, adjust the curvature of a shape mask, adjustthe size of a shape mask, and move the shape mask with respect to theimage.

In some embodiments, the shape masking tool provides a set ofuser-selectable GUI controls, which are displayed along with the shapemask over an image, for performing such manipulations of the shape mask.The set of GUI controls includes, in some of these embodiments, GUIcontrols for adjusting the shape of the shape mask, adjusting thecurvature of the shape mask, adjusting the size of the shape mask, andmoving the shape mask with respect to the image.

Some embodiments of the shape masking tool provide a shape mask that isfor identifying the first and second regions in an image. The shape maskof some of these embodiments is a pair of differently-size,manipulatable, concentric, and two-dimensional shapes that is displayedover the image in order to identify the first and second regions in theimage. In some embodiments, the smaller shape of the shape mask (alsoreferred to as an inner shape) are for identifying the first region inthe image, and the larger shape of the shape mask (also referred to asan outer shape) is for identifying the second region in the image (e.g.,a transition region of the shape mask). Specifically, the shape maskingtool identifies pixels in the image that are within the inner shape aspixels included in the first region of the image, and identifies pixelsin the image that are within the outer shape but outside the inner shapeas pixels included in the second region of the image.

Some embodiments of the shape mask that is for identifying the first andsecond regions in an image allow the user to manipulate the shape maskin a similar manner described above. In some of these embodiments,manipulating the inner shape (e.g., adjusting the size of the innershape, adjusting the shape of the inner shape, adjusting the curvatureof the inner shape) causes a corresponding manipulation of the outershape of the shape mask, and manipulating the outer shape (e.g.,adjusting the size of the inner shape, adjusting the shape of the innershape, adjusting the curvature of the inner shape) causes acorresponding manipulation of the inner shape of the shape mask.However, manipulations to the outer shape of the shape (e.g., scalingthe outer shape), in some embodiments, may have no affect on the innershape of the shape mask.

In some embodiments, the inner shape of the shape mask is for indicatingpixels that are within smaller shape as fully selected pixels, and theouter shape of the shape mask is for indicating pixels that are withinthe larger shape but outside the smaller shape as partially selectedpixels. The shape mask of these embodiments is also referred to as aninner shape mask. Some embodiments indicate pixels that are outside theouter shape of the shape mask as fully selected pixels, and indicatepixels that are inside the outer shape of the shape mask but outside theinner shape of the shape mask as partially selected pixels. The shapemask of these embodiments is also referred to as an outer shape mask.When color correction operations are applied to the image, the colorcorrection operation is fully applied to pixels that are fully selected,and the color correction operation is partially applied to pixels thatare partially selected, in some embodiments, so that a smooth transitionexists between pixels in the image to which the color correctionoperation is applied and pixels in the image to which the colorcorrection operation is not applied.

The preceding Summary is intended to serve as a brief introduction tosome embodiments of the invention. It is not meant to be an introductionor overview of all inventive subject matter disclosed in this document.The Detailed Description that follows and the Drawings that are referredto in the Detailed Description will further describe the embodimentsdescribed in the Summary as well as other embodiments. Accordingly, tounderstand all the embodiments described by this document, a full reviewof the Summary, Detailed Description and the Drawings is needed.Moreover, the claimed subject matters are not to be limited by theillustrative details in the Summary, Detailed Description and theDrawing, but rather are to be defined by the appended claims, becausethe claimed subject matters can be embodied in other specific formswithout departing from the spirit of the subject matters.

BRIEF DESCRIPTION OF THE DRAWINGS

The patent or application file contains at least one drawing executed incolor. Copies of this patent or patent application publication withcolor drawing(s) will be provided by the Office upon request and paymentof the necessary fee.

The novel features of the invention are set forth in the appendedclaims. However, for purposes of explanation, several embodiments of theinvention are set forth in the following figures.

FIG. 1 conceptually illustrates a graphical user interface (GUI) of amedia-editing application that provides a color masking tool of someembodiments.

FIG. 2 conceptually illustrates several states of a three-dimensionalcolor space that correspond to several of the stages illustrated in FIG.1 according to some embodiments of the invention.

FIG. 3 conceptually illustrates a GUI of a media-editing applicationthat provides a color masking tool of some embodiments.

FIG. 4 conceptually illustrates several states of a three-dimensionalcolor space that correspond to several of the stages illustrated in FIG.3 according to some embodiments of the invention.

FIG. 5 conceptually illustrates a GUI of a media-editing applicationthat provides a color masking tool of some embodiments.

FIG. 6 conceptually illustrates several states of a three-dimensionalcolor space that correspond to several of the stages illustrated in FIG.5 according to some embodiments of the invention.

FIG. 7 conceptually illustrates a process of some embodiments fordefining a superellipsoid in a three-dimensional color space.

FIG. 8 conceptually illustrates the determination of a bounding box fordefining a color mask according to some embodiments of the invention.

FIG. 9 conceptually illustrates adjustments to a coordinate system inwhich the bounding box illustrated in FIG. 8 is defined according tosome embodiments of the invention.

FIG. 10 conceptually illustrates the determination of asuperellipse-based shape based on the bounding box illustrated in FIG. 9according to some embodiments of the invention.

FIG. 11 conceptually illustrates a process of some embodiments foridentifying a portion of an image that is included in a color mask.

FIG. 12 conceptually illustrates a process of some embodiments fordefining a color mask after colors are removed from an existing colormask.

FIG. 13 conceptually illustrates the determination of intersectionsbetween bounding boxes in a three-dimensional color space according tosome embodiments of the invention.

FIG. 14 conceptually illustrates the determination of a new bounding boxaccording to some embodiments of the invention.

FIG. 15 conceptually illustrates the determination of asuperellipse-based shaped based on the bounding box illustrated in FIG.14 according to some embodiments of the invention.

FIG. 16 conceptually illustrates a process of some embodiments fordetecting intersections among between two triangles in athree-dimensional space.

FIG. 17 conceptually illustrates the determination of intersectionsbetween the bounding boxes illustrated in FIG. 13 according to someembodiments of the invention.

FIG. 18 conceptually illustrates the determination of intersectionsbetween the bounding boxes illustrated in FIG. 13 according to someembodiments of the invention.

FIG. 19 conceptually illustrated a process of some embodiments fordefining a transition region for a color mask.

FIG. 20A conceptually illustrates several examples of transition regionsdefined in a three-dimensional RGB color space according to someembodiments of the invention.

FIG. 20B conceptually illustrates two-dimensional views of the definedtransition regions illustrated in FIG. 20A.

FIG. 21 conceptually illustrates a graphical user interface (GUI) of amedia-editing application of some embodiments of the invention thatprovides a color masking tool.

FIG. 22 conceptually illustrates a graphical user interface (GUI) of amedia-editing application of some embodiments of the invention thatprovides a shape masking tool.

FIG. 23 illustrates an example operation of moving a shape maskaccording to some embodiments of the invention.

FIG. 24 illustrates example operations of adjusting the shape of a shapemask along a dimension of the shape mask according to some embodimentsof the invention.

FIG. 25 illustrates example operations of adjusting the shape of a shapemask along a dimension of the shape mask according to some embodimentsof the invention.

FIG. 26 illustrates example operations of scaling a shape mask accordingto some embodiments of the invention.

FIG. 27 illustrates example operations of rotating a shape maskaccording to some embodiments of the invention.

FIG. 28 illustrates example operations of adjusting a curvature of ashape mask according to some embodiments of the invention.

FIG. 29 illustrates example operations of adjusting a transition regionof a shape mask according to some embodiments of the invention.

FIG. 30 illustrates example adjustments to a transition region of ashape mask according to some embodiments of the invention.

FIG. 31 illustrates example adjustments to a transition region of ashape mask according to some embodiments of the invention.

FIG. 32 illustrates an example sequence of operations that manipulate ashape mask into a number of different shapes and sizes according to someembodiments of the invention.

FIG. 33 illustrate an example of assigning different alpha values topixels in an image based on a shape mask according to some embodimentsof the invention.

FIG. 34 illustrate examples of assigning different alpha values topixels in an image based on a shape mask according to some embodimentsof the invention.

FIGS. 35A-37B illustrate operations of manipulating a shape mask tocover areas of interest of different sizes and shapes according to someembodiments of the invention.

FIG. 38 illustrates simultaneously applying a color correction operationbased on an inner mask option of a shape mask and another colorcorrection operation based on an outer mask option of the shape maskaccording to some embodiments of the invention.

FIG. 39 conceptually illustrates a masking tool of some embodiments thatincludes a color masking tool and a shape masking tool.

FIG. 40 illustrates a GUI of a media-editing application of someembodiments.

FIG. 41 conceptually illustrates a software architecture of amedia-editing application of some embodiments.

FIG. 42 conceptually illustrates an electronic system with which someembodiments of the invention are implemented.

DETAILED DESCRIPTION

In the following description, numerous details are set forth for purposeof explanation. However, one of ordinary skill in the art will realizethat the invention may be practiced without the use of these specificdetails. For instance, many of the examples illustrate defining colormasks in a three-dimensional RGB color space. However, variousembodiments may define color masks in another three-dimensional colorspace, such as a gamma corrected RGB color space, a Y′CbCr color space,or a Hue, Saturation, and Lightness (HSL) color space.

Some embodiments of the invention provide a novel color masking tool fora media-editing application. The color masking tool of some embodimentsdefines a first portion of a three-dimensional color space based on aselection (e.g., received from a user through a GUI of the media-editingapplication) of a first portion of an image (e.g., a still image, aframe or field of a video clip, etc.). In some embodiments, the firstportion of the three-dimensional color space is a superellipse-basedshape (e.g., a super-ellipsoid or superellipsoid) that includes pixelvalues in the three-dimensional color space of pixels in the firstportion of the image.

An image in some embodiments is an array of pixels (e.g., 800×600pixels, 1024×768 pixels, 1600×1200 pixels). Each pixel represents aportion of the image and includes the color and brightness informationfor such portion of the image. Different embodiments represent the colorand brightness information of pixels in an image differently fordifferent color spaces. For instance, for an image defined in an RGBcolor space, the pixels' color and brightness information is representedby a red component value, a green component value, and a blue componentvalue in some embodiments. In other embodiments, the color andbrightness of pixels of an image defined in a Y′CbCr color space arerepresented by using a luma (Y′) component value for brightness and ablue-difference (Cb) component value and a red-difference (Cr) componentvalue for chrominance (i.e., color). In some embodiments, the lumacomponent is the weighted sum of the nonlinear gamma compressed R′G′B′components. In some of these embodiments, R′G′B′ is gamma corrected red,green, and blue components. Other ways of representing the pixels' colorand brightness are possible for images defined in other color spaces.

FIG. 1 conceptually illustrates a graphical user interface (GUI) 100 ofa media-editing application of some embodiments that provides a colormasking tool. Specifically, FIG. 1 illustrates the GUI 100 at sixdifferent stages 110-160 of a color masking operation of the colormasking tool that defines a color mask.

As shown, the GUI 100 includes a user-selectable user interface (UI)item 170, a user-selectable UI item 175, and an image display area 180.The image display area 180 displays an image for a user to edit with aset of editing tools (not shown). In some embodiments, the image displayarea 180 allows the user to select portions of the image (e.g., using aselection tool) through the image display area 180.

The user-selectable UI item 170 is a conceptual illustration of one ormore UI items that allows a positive (or additive) color masking tool tobe invoked (e.g., by a cursor operation such as clicking a mouse button,tapping a touchpad, or touching the UI item on a touchscreen). When thepositive color masking tool is invoked, the user can select a portion ofthe image through the image display area 180 in order to create a colormask or to modify (e.g., by adding colors to) an existing color mask.Based on the selected portion of the image, the positive color maskingtool of some embodiments defines a color mask. In some embodiments, acolor mask specifies a set of pixels in the image that has the same orsimilar color values as the color values of the pixels in the selectedportion of the image.

Different embodiments implement the UI item 170 differently. Some suchembodiments implement the UI item 170 as a UI button while otherembodiments implement the UI item 170 as a menu selection command thatcan be selected through a pull-down, a drop-down, or a pop-up menu.Still other embodiments implement the UI item 170 as a keyboard commandthat can be invoked through one or more keystrokes or a series ofkeystrokes (e.g., pressing and holding a key to activate the positivecolor masking tool and releasing the key to deactivate the positivecolor masking tool). Yet other embodiments allow the user to activatethe positive color masking tool through two or more of such UIimplementations or other UI implementations.

The user-selectable UI item 175 is also a conceptual illustration of oneor more UI items that allows a color correction operation to be invoked(e.g., by a cursor operation such as clicking a mouse button, tapping atouchpad, or touching the UI item on a touchscreen). Examples of colorcorrection operations include hue adjustments, saturation adjustments,brightness adjustments, or any other type of color correction operation.When the color correction operation is invoked, the positive colormasking tool applies the color correction operation to the image. Insome embodiments, the positive color masking tool applies the colorcorrection operation to the image by modifying pixels in the image thatare included in the color mask. In some cases where a color mask has notbeen created, the color correction operation is applied to all thepixels in the image. Additionally, the UI item 175 can be implementedany number of different ways, including those described for the UI item170, in different embodiments.

The operation of the GUI 100 will now be described by reference to thesix different stages 110-160 that are illustrated in FIG. 1. The firststage 110 illustrates an image 190 displayed in the image display area180. In some embodiments, the media-editing application displays theimage 190 in the image display area 180 when the media-editingapplication receives a selection (e.g., through a keyboard command(s) ora cursor operation) of a representation of the image 190 (e.g., athumbnail, text, icon, etc.) in another region (not shown) of themedia-editing application (e.g., a file browser, an event library, acompositing display area, etc.).

As shown, the image 190 displayed in the image display area 180 is of aperson playing a guitar with mountains and a sun in the background. Insome embodiments, the image 190 may be a still image, an image (frame orfield) in a video, or any other type of image. In this example, theimage 190 is a still image.

The second stage 120 of the GUI 100 illustrates that the user hasactivated the positive color masking tool by selecting the UI item 170using a cursor (e.g., by clicking a mouse button, tapping a touchpad, ortouching a touchscreen), as indicated by a highlighting of the UI item170. In addition, the second stage 120 shows a selection tool 195displayed in the image display area 180. As shown, the selection tool195 in this example is a circle with a cross hair displayed in thecenter of the circle. The user can control the selection tool 195 bymoving the cursor (e.g., by moving a mouse across a surface, touchingand dragging a finger across a touchpad, or touching and dragging afinger across a touchscreen) in some embodiments. In some embodiments,the media-editing application provides the selection tool 195 when thepositive color masking tool is activated.

In addition, the second stage 120 shows that the user has selected aportion of the image 190 displayed in the image display area 180 usingthe selection tool 195 (e.g., by clicking a mouse button, tapping atouchpad, or touching a touchscreen) in order to create a color mask. Inparticular, the user has created a color mask by selecting a portion ofthe left mountain in the image 190. When the media-editing applicationreceives the selection, some embodiments of the positive color maskingtool of the media-editing application define a color mask based on theselection. As mentioned above, a color mask specifies a set of pixels inan image that has the same or similar color values as the color valuesof the pixels in the selected portion of the image. In this example, thecolor of the left mountain is all the same color. As such, the positivecolor masking tool of some embodiments defines a color mask thatspecifies pixels in the image 190 that have the same color values as thecolor values of the pixels in the selected portion of the left mountain.

The third stage 130 illustrates the GUI 100 after a color mask has beencreated based on the portion of the image 190 selected in the secondstage 120. As shown, the portion of the image 190 (i.e., pixels)displayed in the image display area 180 that is specified as beingincluded in the color mask is indicated by diagonal lines in order toprovide the user with a visual indication of the portion of the image190 that is included in the color mask. In particular, the left mountainin the image 190 is indicated by diagonal lines. In some embodiments,the media-editing application displays the diagonal lines after themedia-editing application defines the color mask.

Although the third stage 130 illustrates diagonal lines to indicate theportion of the image 190 included in the color mask, other embodimentsof the media-editing application display such indications differently.For instance, some such embodiments might indicate the portion of theimage 190 included in the color mask with patterns (e.g., dots), colorindicators, animations (e.g., flashing colors), textual indicators, orany other type of visual indicator.

The third stage 130 also shows that the UI item 170 is no longerhighlighted and the cursor is provided instead of the selection tool195. In some embodiments, when the media-editing application receives aselection of a portion of the image to create a color mask, themedia-editing application deactivates the positive color masking tool,removes the highlighting of the UI item 170, and provides a cursorinstead of the selection tool 195. Some embodiments of the media-editingapplication may not deactivate the positive color masking tool when themedia-editing application receives a selection of a portion of the imageto create a color mask in order to allow the user to continue creatingor adding colors to a color mask. In some such embodiments, themedia-editing application continues to highlight the UI item 170 and toprovide the selection tool 195.

In the fourth stage 140, the GUI 100 illustrates-using the positivecolor masking tool to add colors to an existing color mask.Specifically, the fourth stage 140 shows that the user has activated thepositive color masking tool by selecting the UI item 170 using a cursor(e.g., by clicking a mouse button, tapping a touchpad, or touching atouchscreen), as indicated by a highlighting of the UI item 170. Thefourth stage 140 also illustrates the selection tool 195 displayed inthe image display area 180. In some embodiments, the media-editingapplication provides the selection tool 195 when the positive colormasking tool is activated.

The fourth stage 140 additionally shows that the user has selected aportion of the right mountain in the image 190 displayed in imagedisplay area 180 using the selection tool 195 (e.g., by clicking a mousebutton, tapping a touchpad, or touching the mountain on a touchscreen)in order to add colors in the portion of the right mountain to the colormask created in the second stage 120. For this example, the color of theright mountain is all the same color, which is similar to the color ofthe left mountain. In addition, the area below the right side of theright mountain is also the same color as the color of the rightmountain. As such, the positive color masking tool of some embodimentsmodifies (e.g., redefines) the color mask that was defined in the secondstage 120 so that the color mask specifies pixels in the image 190 thathave the same color values as the color values of the pixels in theselected portion of the right mountain in addition to specifying pixelsin the image 190 that have the same color values as the color values ofthe pixels in the selected portion of the left mountain. In someembodiments, the positive color masking tool of the media-editingapplication modifies (e.g., redefines) the existing color mask when themedia-editing application receives a selection of a portion of the rightmountain to add colors to the color mask.

The fifth stage 150 illustrates the GUI 100 after colors have been addedto an existing color mask based on the portion of the image 190 selectedin the fourth stage 140. As shown, the area below the right side of theright mountain is included in the color mask. In this example, the colorvalues of the pixels in the right mountain are similar enough to colorvalues of pixels below the right side of the right mountain that thosepixels below the right side of the right mountain are included in thecolor mask. As such, the fifth stage 150 shows diagonal lines displayedon the area below the right mountain as well as the right mountainitself to indicate that this portion of the image 190 (i.e., pixels) isincluded in the color mask. Again, these diagonal lines are displayed inorder to provide the user with a visual indication of the portion of theimage 190 that is included in the color mask. Additional and/or othertypes of visual indicators noted above by reference to the third stage130 may be used in different embodiments. In some embodiments, themedia-editing application displays the diagonal lines after themedia-editing application defines the color mask.

Like the third stage 130, the fifth stage 150 shows that the UI item 170is not highlighted and the selection tool 195 is no longer provided. Themedia-editing application of some embodiments deactivates the positivecolor masking tool, removes the highlighting of the UI item 170, andprovides a cursor instead of the selection tool 195 when themedia-editing application receives a selection of a portion of the imageto add colors to an existing color mask. In some embodiments, themedia-editing application may not deactivate the positive color maskingtool when the media-editing application receives a selection of aportion of the image to add colors to an existing color mask in order toallow the user to continue adding colors to the color mask. In some ofthese embodiments, the media-editing application continues to highlightthe UI item 170 and to provide the selection tool 195.

The sixth stage 160 illustrates that the user has invoked a colorcorrection operation by selecting the UI item 175 using the cursor(e.g., by clicking a mouse button, tapping a touchpad, or touching atouchscreen), which is indicated by a highlighting of the UI item 175.As mentioned above, the color correction operation can be any type ofcolor correction operation (e.g., hue adjustments, saturationadjustments, brightness adjustments) in different embodiments. As shown,the sixth stage 160 displays crossing diagonal lines to indicate theportion of the image 190 (which is the portion of the image 190specified by the color mask defined in the fourth stage 140) to whichthe color correction operation is applied.

In some embodiments, the media-editing application provides a persistentcolor correction operation. For instance, a user might adjust a colormask or create a new color mask after a color correction operation hasbeen applied to an image. In such embodiments, the media-editingapplication continues to apply the color correction to the image usingthe current color mask. In other embodiments, the media-editingapplication may provide a transient color correction operation. In theseembodiments, when the user adjusts the color mask after a colorcorrection operation has been applied to the image, the media-editingapplication removes (e.g., deletes) the color correction operation andthe user will have to apply another color correction operation to theimage if the user wishes to apply a color correction operation to theimage.

While FIG. 1 illustrates a positive color masking tool allowing a userto add colors to an existing color mask, some embodiments of thepositive color masking tool create a new color mask in a similar mannerdescribed above by reference to the second stage 120 when themedia-editing application receives a selection of a portion of the imageafter having previously received another portion of the image.

As shown, the above FIG. 1 illustrates a GUI of a media-editingapplication for creating a color mask for an image. As noted above, thepositive color masking tool of some embodiments defines a portion of athree-dimensional color space based on a selection of a portion of animage (e.g., through a GUI of a media-editing application that providesthe positive color masking tool). In some embodiments, the positivecolor masking tool defines a color mask for the image based on thedefined portion of the three-dimensional color space.

FIG. 2 conceptually illustrates several states of a three-dimensionalcolor space that correspond to several of the stages illustrated inFIG. 1. Specifically, FIG. 2 conceptually illustrates four differentstates 210-240 of a positive color masking tool of some embodimentsdefining superellipse-based shapes in a three-dimensional color space.

As shown, the three-dimensional color space is an RGB color space, asindicated by the R, G, and B labels along the axes of thethree-dimensional color space. A cube that is flush along the axes ofthe three-dimensional RGB color space is displayed to indicate themaximum values of the range of values along each axis. Differentembodiments may define the range of values along the axes of thethree-dimensional RGB color space differently. For instance, someembodiments define 256 values (e.g., 0-255) along each axis, whichcorrespond to the range of values used to define a pixel in an image. Insome such embodiments where the range of values is defined to be 0-255,the point in the three-dimensional RGB color space farthest from theorigin would have RGB component values of 255, 255, and 255. Otherranges of values are possible in other embodiments.

In this example, image 190 is defined in RGB color space. Accordingly,the RGB component values of pixels in the image 190 are used to plot thepixels' corresponding points in the three-dimensional RGB color space.In instances where the image 190 is defined in another color space, thepositive color masking tool of some embodiments converts the image 190to the RGB color space (e.g., by applying a set of transforms forconverting the color space of the image to the RGB color space) in orderto determine the RGB component values of the pixels in the image 190.

The first state 210 of the three-dimensional color space corresponds tothe second stage 120 illustrated in FIG. 1. As described above, thesecond stage 120 illustrates that the user has selected a portion of theleft mountain in the image 190 in order to create a color mask. Thepoints plotted in the three-dimensional RGB color space represent theRGB component values of the pixels in the selected portion of the image190. When the media-editing application receives the selection of theportion of the image 190, some embodiments of the positive color maskingtool identify the pixels in the selected portion of the image 190 anddetermine the location of corresponding points in the three-dimensionalRGB color space for each of the identified pixels.

The second state 220 of the three-dimensional RGB color spacecorresponds to the third stage 130 illustrated in FIG. 1. The thirdstage 130, as described above, illustrates the GUI 100 after a colormask has been created based on the portion of the image 190 selected inthe second stage 120. As noted above, some embodiments of the colormasking tool define a portion of a three-dimensional color space basedon a selection of a portion of an image. As shown in the second state220 of the three-dimensional RGB color space, the positive color maskingtool has defined a portion of the three-dimensional RGB color spacebased on RGB component values of the pixels in the portion of the image190 that was selected in the second stage 120. Specifically, the portionof the three-dimensional RGB color space includes RGB component valuesthat are the same or similar to the RGB component values of the pixelsin the selected portion of the image 190. As illustrated in the state220, the portion of the three-dimensional RGB color space is asuperellipsoid 250 in this example. In some embodiments, the positivecolor masking tool defines the superellipsoid 250 when the media-editingapplication receives the selection of the portion of the image 190 inthe second stage 120.

Based on the superellipsoid 250, some embodiments of the positive colormasking tool define a color mask. In this example, the positive colormasking tool defines a color mask that specifies pixels in the image 190that have RGB component values included in the superellipsoid 250. Asillustrated in the third stage 130, diagonal lines are displayed on theportion of the image 190 (i.e., pixels) that is included in the colormask. The positive color masking tool of some embodiments uses thesuperellipsoid 250 to identify the portion of the image 190 (i.e.,pixels) that is included in the color mask in order for themedia-editing application to display visual indicators (e.g., diagonallines in this example) on such portion of the image 190. FIG. 11, whichis described in further detail below, illustrates a process of someembodiments for identifying a portion of an image that is included in acolor mask.

The third state 230 of the three-dimensional RGB color space correspondsto the fourth stage 140 illustrated in FIG. 1. As mentioned above, thefourth stage 140 illustrates that the user has selected a portion of theright mountain in the image 190 in order to add colors in the portion ofthe right mountain to the color mask created in the second stage 120. Inthe third state 230, the superellipsoid 250 is not shown for the sake ofclarity. However, in some embodiments, the superellipsoid 250 stillexists (i.e., the color mask defined in the second state 220 stillexists). As shown, additional points are plotted to the right of thepoints illustrated in the first state 210 of the three-dimensional RGBcolor space. These additional points represent the RGB component valuesof the pixels in the selected portion of the right mountain in the image190. When the media-editing application receives the selection of theportion of the right mountain in the image 190, some embodiments of thepositive color masking tool identify the pixels in the selected portionof the right mountain in the image 190 and determine the correspondinglocation in the three-dimensional RGB color space of each of theidentified pixels.

The fourth state 240 of the three-dimensional RGB color spacecorresponds to the fifth stage 150 illustrated in FIG. 1. The fifthstage 150, as previously described, illustrates the GUI 100 after colorshave been added to an existing color mask based on the portion of theimage 190 selected in the fourth stage 140. As illustrated in the fourthstate 240 of the three-dimensional RGB color space, the positive colormasking tool has defined a portion of the three-dimensional RGB colorspace based on RGB component values of the pixels in the portions of theimage 190 that were selected in the second stage 120 and the fourthstage 140. In particular, the portion of the three-dimensional RGB colorspace includes RGB component values that are the same or similar to theRGB component values of the pixels in the selected portions of the image190. As shown, the portion of the three-dimensional RGB color space is asuperellipsoid 260 in this example. In some embodiments, the positivecolor masking tool defines the superellipsoid 260 when the media-editingapplication receives the selection of the portion of the image 190 inthe fourth stage 140.

Based on the superellipsoid 260, some embodiments of the positive colormasking tool define a color mask. For this example, the positive colormasking tool defines a color mask that specifies pixels in the image 190that have RGB component values included in the superellipsoid 260. Asshown in the fifth stage 150, diagonal lines are displayed on theportion of the image 190 (i.e., pixels) that is included in the colormask. Some embodiments of the positive color masking tool use thesuperellipsoid 260 to identify the portion of the image 190 (i.e.,pixels) that is included in the color mask in order for themedia-editing application to display visual indicators (e.g., diagonallines in this example) on the portion of the image 190. As mentionedabove, FIG. 11, which is described in more detail below, illustrates aprocess of some embodiments for identifying a portion of an image thatis included in a color mask.

The above figures illustrate examples of creating a color mask andadding colors to an existing color mask. However, in some instances, theuser may want to remove colors from an existing color mask. Forinstance, in the example illustrated in FIG. 1, the user might be tryingto select the mountains and nothing else in the image 190. Afterselecting the portion of the right mountain to add colors to the colormask, the color values of the pixels in the selected portion of theright mountain are similar enough to color values of pixels below theright side of the right mountain that those pixels below the right sideof the right mountain are included in the color mask. In some cases, theuser might want to remove the colors of the pixels below the right sideof the right mountain from the color mask.

FIG. 3 conceptually illustrates a GUI 300 of a media-editing applicationthat provides a color masking tool of some embodiments. Specifically,FIG. 3 illustrates the GUI 300 at three different stages 310-330 of acolor masking operation of the color masking tool that removes colorsfrom an existing color mask.

The GUI 300 is similar to the GUI 100 illustrated in FIG. 1 but the GUI300 includes an additional user-selectable UI item 340. Theuser-selectable UI item 340 is a conceptual illustration of one or moreUI items that allows a negative (or subtractive) color masking tool tobe invoked (e.g., by a cursor operation such as clicking a mouse button,tapping a touchpad, or touching the UI item on a touchscreen). When thenegative color masking tool is invoked, the user can select a portion ofthe image through the image display area 180 in order to remove colorsfrom an existing color mask. Based on the selected portion of the image,the negative color masking tool of some embodiments defines a colormask. As mentioned above, a color mask of some embodiments specifies aset of pixels in the image that has the same or similar color values asthe color values of the pixels in the selected portion of the image.

Different embodiments implement the UI item 340 differently. Someembodiments implement the UI item 340 as a UI button while otherembodiments implement the UI item 340 as a menu selection command thatcan be selected through a pull-down, drop-down, or pop-up menu. Otherembodiments implement the UI item 340 as a keyboard command that can beinvoked through one or more keystrokes or a series of keystrokes (e.g.,pressing and holding a key to activate the negative color masking tooland releasing the key to deactivate the negative color masking tool).Yet other embodiments allow the user to invoke the negative colormasking tool through two or more of such UI implementations or other UIimplementations.

The first stage 310 is similar to the fifth stage 150 illustrated inFIG. 1. The first stage 310 illustrates the GUI 300 after colors havebeen added to an existing color mask based on the portion of the image190 selected in the fourth stage 140. In addition, diagonal lines aredisplayed on the portion of the image 190 (i.e., pixels) in the imagedisplay area 180 that is specified as being included in the color mask.

The second stage 320 illustrates that the user has activated thenegative color masking tool by selecting the UI item 340 using a cursor(e.g., by clicking a mouse button, tapping a touchpad, or touching atouchscreen), as indicated by a highlighting of the UI item 340. Thesecond stage 320 also shows the selection tool 195 displayed in theimage display area 180. In some embodiments, the media-editingapplication provides the selection tool 195 when the negative colormasking tool is activated.

In addition, the second stage 320 illustrates that the user has selecteda portion of the image 190 displayed in the image display area 180 usingthe selection tool 195 (e.g., by clicking a mouse button, tapping atouchpad, or touching a touchscreen) in order to remove colors from theexisting color mask. Specifically, the user has removed colors from theexisting color mask by selecting a portion of the image 190 below theright side of the right mountain. When the media-editing applicationreceives the selection, some embodiments of the negative color maskingtool of the media-editing application define a color mask based on theselection. As mentioned above, a color mask specifies a set of pixels inan image that has the same or similar color values as the color valuesof the pixels in the selected portion of the image. In this example, thecolor of the area below the right side of the right mountain that isincluded in the color mask is all the same color but different than thecolor of the left and right mountains. Thus, the negative color maskingtool of some embodiments defines a color mask that excludes pixels inthe image 190 that have the same color values as the color values of thepixels in the selected portion of the image 190 below the right side ofthe right mountain.

The third stage 330 illustrates the GUI 300 after colors have beenremoved from the existing color mask based on the portion of the image190 selected in the second stage 320. The portion of the image 190(i.e., pixels) displayed in the image display area 180 that is specifiedas being included in the color mask is indicated by diagonal lines inorder to provide the user with a visual indication of the portion of theimage 190 that is included in the color mask. As shown, the mountains inthe image 190 are still indicated by diagonal lines, but there are nolonger diagonal lines in the area below the right side of the rightmountain. In some embodiments, the media-editing application displaysthe diagonal lines after the media-editing application defines the colormask.

Although the third stage 330 illustrates diagonal lines to indicate theportion of the image 190 included in the color mask, other embodimentsof the media-editing application display such indications differently.For instance, some such embodiments might indicate the portion of theimage 190 included in the color mask with patterns (e.g., dots), colorindicators, animations (e.g., flashing colors), textual indicators, orany other type of visual indicator.

The third stage 330 also shows that the UI item 340 is no longerhighlighted and the cursor is provided instead of the selection tool195. In some embodiments, the media-editing application deactivates thenegative color masking tool, removes the highlighting of the UI item340, and provides a cursor instead of the selection tool 195 when themedia-editing application receives a selection of a portion of the imageto remove colors from an existing color mask. In some embodiments, themedia-editing application may not deactivate the negative color maskingtool when the media-editing application receives a selection of aportion of the image to remove colors from an existing color mask inorder to allow the user to continue adding colors to or removing colorsfrom a color mask. In some such embodiments, the media-editingapplication continues to highlight the UI item 340 and to provide theselection tool 195.

The negative color masking tool of some embodiments defines a portion ofa three-dimensional color space based on a selection of a portion of animage (e.g., through a GUI of a media-editing application that providesthe positive color masking tool) for removing colors from an existingcolor mask, as noted above. In some embodiments, the negative colormasking tool defines a color mask for the image based on the definedportion of the three-dimensional color space.

FIG. 4 conceptually illustrates several states of a three-dimensionalcolor space that correspond to several of the stages illustrated in FIG.3. Specifically, FIG. 4 conceptually illustrates three different states410-430 of a negative color masking tool of some embodiments definingsuperellipse-based shapes in a three-dimensional color space. Thethree-dimensional color space illustrated in FIG. 4 is the samethree-dimensional color space described above by reference to FIG. 2.That is, the three-dimensional color space is a three-dimensional RGBcolor space and the RGB component values of pixels in the image 190 areused to plot the pixels' corresponding points in the three-dimensionalRGB color space.

The first state 410 of the three-dimensional color space corresponds tothe first stage 310 illustrated in FIG. 3. As described above, the firststage 310 is similar to the fifth stage 150 illustrated in FIG. 1. Thefirst stage 310 illustrates the GUI 300 after colors have been added toan existing color mask based on the portion of the image 190 selected inthe fourth stage 140. Therefore, the first state 410 of thethree-dimensional RGB color space is similar to the fourth state 240 ofthe three-dimensional RGB color space illustrated in FIG. 2. That is,the negative color masking tool has defined a portion of thethree-dimensional RGB color space based on RGB component values of thepixels (which correspond to the points plotted in the three-dimensionalRGB color space) in the portion of the image 190 that was selected inthe second stage 120 and the fourth stage 140 of FIG. 1. As mentionedabove, the portion of the three-dimensional RGB color space includes RGBcomponent values that are the same or similar to the RGB componentvalues of the pixels in the selected portions of the image 190. Asshown, the portion of the three-dimensional RGB color space is asuperellipsoid 440, which is similar to the superellipsoid 260illustrated in FIG. 2.

Based on the superellipsoid 440, the negative color masking tool of someembodiments defines a color mask. In this example, the negative colormasking tool defines a color mask that specifies pixels in the image 190that have RGB component values included in the superellipsoid 440. Asillustrated in the first stage 310, diagonal lines are displayed on theportion of the image 190 (i.e., pixels) that is included in the colormask. Some embodiments of the negative color masking tool use thesuperellipsoid 440 to identify the portion of the image 190 (i.e.,pixels) that is included in the color mask. As mentioned above, FIG. 11,which is described in more detail below, illustrates a process of someembodiments for identifying a portion of an image that is included in acolor mask.

The second state 420 of the three-dimensional color space corresponds tothe second stage 320 illustrated in FIG. 3. As mentioned above, thesecond stage 320 illustrates that the user has selected the portion ofthe image 190 below the right side of the right mountain in order toremove colors from the existing color mask. The second state 420 doesnot show the superellipsoid 440 for the purpose of clarity. However, insome embodiments, the superellipsoid 440 still exists (i.e., the colormask defined in the first state 410 still exists). As shown in thesecond state 420, several points on the right side of the plotted pointsillustrated in the first state 410 of the three-dimensional RGB colorspace are grayed out. These gray points represent the RGB componentvalues of the pixels in the selected portion of the image 190 below theright side of the right mountain. When the media-editing applicationreceives the selection, the negative color masking tool of someembodiments identifies points in the three-dimensional RGB color spacethat correspond to the pixels in the selected portion of the image 190below the right side of the right mountain and removes the identifiedpoints from the three-dimensional RGB color space.

The third state 430 of the three-dimensional color space corresponds tothe third stage 330 illustrated in FIG. 3. As described above, the thirdstage 330 illustrates the GUI 300 after colors have been removed fromthe existing color mask based on the portion of the image 190 selectedin the second stage 320. Some embodiments of the color masking tooldefine a portion of a three-dimensional color space based on a selectionof a portion of an image, as mentioned above. As shown in the thirdstate 430 of the three-dimensional RGB color space, the negative colormasking tool has defined a portion of the three-dimensional RGB colorspace based on RGB component values of the pixels in the portion of theimage 190 that was selected in the second stage 320. In particular, thenegative color masking tool has defined a portion of thethree-dimensional RGB color space that includes the RGB component valuesin the three-dimensional RGB color space illustrated in the first state410, but excludes the RGB component values in the three-dimensionalcolor space of the pixels in the portion of the image 190 that wasselected in the second stage 320. As shown in this example, the portionof the three-dimensional RGB color space is a superellipsoid 450. Insome embodiments, the negative color masking tool defines thesuperellipsoid 250 when the media-editing application receives theselection of the portion of the image 190 in the second stage 320.

Based on the superellipsoid 450, some embodiments of the negative colormasking tool define a color mask. In this example, the negative colormasking tool defines a color mask that specifies pixels in the image 190that have RGB component values included in the superellipsoid 450. Asillustrated in the third stage 330, diagonal lines are displayed on theportion of the image 190 (i.e., pixels) that is included in the colormask. Some embodiments of the negative color masking tool use thesuperellipsoid 450 to identify the portion of the image 190 (i.e.,pixels) that is included in the color mask in order for themedia-editing application to display visual indicators (e.g., diagonallines in this example) on such portion of the image 190. As mentionedabove, FIG. 11, which is described in further detail below, illustratesa process of some embodiments for identifying a portion of an image thatis included in a color mask.

The figures above illustrate different ways of defining a color mask foran image. As previously noted above, once a color mask is defined, someembodiments apply color correction operations to the image using thecolor mask. When using the color mask to apply a color correctionoperation to a portion of an image, sharp cutoffs may exist betweenpixels that have colors included in the color mask (to which the colorcorrection operation is applied) and pixels that have colors that aresimilar to the pixels included in the color mask, but are not includedin the color mask (to which the color correction operation is notapplied). As such, some embodiments of the color masking tool define atransition region for the color mask to smooth out such sharp cutoffs.

In some embodiments, a transition region specifies a set of pixels inthe image that has color values that are similar to the color values ofthe pixels included in the color mask, but is not included in the colormask. Pixels in the image that are included in the transition region arepartially selected pixels and pixels in the image that are included inthe color mask are fully selected pixels, in some embodiments.Accordingly, a color correction operation that is applied to the imageis fully applied to fully selected pixels and partially applied topartially selected pixels. In this fashion, the transition betweenpixels in the image to which the color correction operation is appliedand pixels in the image to which the color correction operation is notapplied is smoothed.

FIG. 5 conceptually illustrates a GUI 500 of a media-editing applicationthat provides a color masking tool of some embodiments. In particular,FIG. 5 illustrates the GUI 500 at three different stages 510-530 of acolor masking operation of the color masking tool that defines atransition region for a color mask.

As shown, the GUI 500 is similar to the GUI 300 illustrated in FIG. 3except the GUI 500 includes user-adjustable slider control 540. Theuser-adjustable slider control 540 is a conceptual illustration of oneor more UI items that allows a transition region operation to be invoked(e.g., by a cursor operation such as clicking a mouse button anddragging the mouse, tapping a touchpad and dragging across the touchpad,or touching the slider control displayed on a touchscreen and draggingacross the touchscreen). When the transition region operation isinvoked, the color masking tool defines a transition region for a colormask based on the position of the slider indicator on the slider control540. In some embodiments, different positions of the slider indicatoralong the slider control 540 corresponds to different transition regionvalues (e.g. offset values).

Different embodiments of the user-adjustable slider control 540 definethe position of the slider indicator along the slider control 540differently. In the following example, the leftmost position on theslider control 540 does not define a transition region. However, in someembodiments of the slider control 540, the leftmost position on theslider control 540 specifies a default transition region. As theposition on the slider control 540 moves from left to right, thetransition region increases.

Different embodiments implement the UI item 540 differently. Someembodiments implement the slider control 540 as a textbox (in which auser can input values that correspond to the size of the transitionregion) while other embodiments implement the slider control 540 as amenu selection command that can be selected through a pull-down, adrop-down, or a pop-up menu. Still other embodiments implement theslider control 540 as a keyboard command that can be invoked through oneor more keystrokes or a series of keystrokes. Yet other embodimentsallow the user to invoke the transition region operation through two ormore of such UI implementations or other UI implementations.

The first stage 510 is similar to the third stage 330 illustrated inFIG. 3. The first stage 3C0 illustrates the GUI 500 after colors havebeen removed from an existing color mask based on the portion of theimage 190 selected in the third stage 330. Similar to the third stage330, the first stage 510 shows diagonal lines displayed on the portionof the image 190 (i.e., pixels) in the image display area 180 that isspecified as being included in the color mask. In addition, the firststage 510 illustrates that a transition region has not been defined, asindicated by the leftmost position of the slider indicator on the UIslider control 540.

The second stage 520 illustrates that the user has moved the sliderindicator to the middle of the slider control 540 using the cursor(e.g., by clicking a mouse button and dragging the mouse, tapping atouchpad and dragging across the touchpad, or touching the slidercontrol displayed on a touchscreen and dragging across the touchscreen)in order to invoke a transition region operation. In some embodiments,the color masking tool defines the transition region when themedia-editing application receives the movement of the slider indicatoron the slider control 540.

Additionally, the second stage 520 illustrates that a transition regionfor the color mask has been defined based on the position of the sliderindicator on the slider control 540. In this example, the transitionregion is indicated by a gray color that is displayed in the image 190.As shown, the transition region is located in the right portion of theground, which is below the right side of the mountains. As mentionedabove, a transition region specifies a set of pixels in an image thathas color values that are similar to the color values of pixels includedin a color mask, but is not included in the color mask. As describedabove by reference to the fifth stage 150 of FIG. 1, the color values ofpixels in the area below the right mountain are similar to the colorvalues of the pixels in the right mountain. Therefore, this area andother areas below the mountains are included in the transition regionfor the color mask.

While the second stage 520 illustrates a gray color to indicate theportion of the image 190 included in the transition region, otherembodiments of the media-editing application display such indicatordifferently. For instance, some such embodiments might indicate theportion of the image included in the transition region with patterns(e.g., dots), other color indicators, animations (e.g., flashingcolors), textual indicators, or any other type of visual indicator.

The third stage 530 illustrates that the user has moved the sliderindicator near the right side of the slider control 540 using the cursor(e.g., by clicking a mouse button and dragging the mouse, tapping atouchpad and dragging across the touchpad, or touching the slidercontrol displayed on a touchscreen and dragging across the touchscreen)and that a transition region for the color mask has been defined basedon the position of the slider indicator on the slider control 540.

As illustrated in the third stage 530, the transition region shown inthe second stage 520 has increased. As noted above, the color values ofpixels in the area below the right mountain are similar to the colorvalues of the pixels in the right mountain. For this example, the colorvalues of pixels below the mountains is similar to the color values ofthe mountains, but not as similar as the area included in the transitionregion illustrated in the second stage 520. Since the transition regionhas increased in this stage compared to the second stage 520, a largerarea below the mountains are included in the transition region for thecolor mask. In some embodiments, the color masking tool defines thetransition region when the media-editing application receives themovement of the slider indicator on the slider control 540.

As mentioned above, the color masking tool of some embodiments definesan offset portion of the three-dimensional color space that encompasses,but does not include, a portion of the three-dimensional color spacedefined for a color mask. In some embodiments, the color masking tooldefines a transition region for the color mask based on the definedoffset portion of the three-dimensional color space.

FIG. 6 conceptually illustrates several states of a three-dimensionalcolor space that correspond to the stages illustrated in FIG. 5. Inparticular, FIG. 6 conceptually illustrates three different states610-630 of a color masking tool of some embodiments definingsuperellipse-based offset shapes in a three-dimensional color space. Thethree-dimensional color space illustrated in FIG. 6 is the samethree-dimensional color space described above by reference to FIG. 2. Asdescribed above, the three-dimensional color space is athree-dimensional RGB color space and the RGB component values of pixelsin the image 190 are used to plot the pixels' corresponding points inthe three-dimensional RGB color space.

The first state 610 of the three-dimensional color space corresponds tothe first stage 510 illustrated in FIG. 5. The first stage 510 issimilar to the third stage 330 illustrated in FIG. 3, as mentionedabove. The first stage 510 illustrates the GUI 500 after colors havebeen removed from an existing color mask based on the portion of theimage 190 selected in the third stage 330. As such, the first state 610of the three-dimensional RGB color space is similar to the third state430 of the three-dimensional RGB color space illustrated in FIG. 4. Thatis, the color masking tool has defined a portion of thethree-dimensional RGB color space that excludes the RGB component valuesin the three-dimensional color space of the pixels in the portion of theimage 190 that was selected in the second stage 320 (and that includesRGB component values of the pixels in the portion of the image 190 thatwas selected in the second stage 120 and the fourth stage 140 of FIG.1). As illustrated, the portion of the three-dimensional RGB color spaceis a superellipsoid 640, which is similar to the superellipsoid 440illustrated in FIG. 4.

Based on the superellipsoid 640, the color masking tool of someembodiments defines a color mask. For this example, the color maskingtool defines a color mask that specifies pixels in the image 190 thathave RGB component values included in the superellipsoid 640. Asillustrated in the first stage 510, diagonal lines are displayed on theportion of the image 190 (i.e., pixels) that is included in the colormask. The color masking tool of some embodiments uses the superellipsoid640 to identify the portion of the image 190 (i.e., pixels) that isincluded in the color mask. As mentioned above, FIG. 11, which isdescribed in more detail below, illustrates a process of someembodiments for identifying a portion of an image that is included in acolor mask.

Since the first stage 510 illustrates that a transition region has notbeen defined, the color masking tool of some embodiments did not definean offset portion for the color mask in the first state 610 of thethree-dimensional color space.

The second state 620 of the three-dimensional color space corresponds tothe second stage 520 illustrated in FIG. 5. As described above, thesecond stage 520 illustrates that the user has moved the sliderindicator to the middle of the slider control 540 in order to invoke atransition region operation that defines a transition region for thecolor mask based on the position of the slider indicator on the slidercontrol 540. As mentioned above, the color masking tool of someembodiments defines an offset portion of the three-dimensional colorspace that encompasses, but does not include, a portion of thethree-dimensional color space defined for a color mask. As shown in thesecond state 620 of the three-dimensional RGB color space, the colormasking tool has defined such an offset portion of the three-dimensionalRGB color space based on the position of the slider indicator on theslider control 540.

In this example, the offset portion is a superellipsoid 650, whichencompasses, but does not include, the superellipsoid 640. In someembodiments, the color masking tool defines the superellipsoid 650 whenthe media-editing application receives the slider movement of the slidercontrol 540 in the second stage 520.

The color masking tool of some embodiments defines a transition regionfor the color mask based on the superellipsoid 650. In this example, thecolor masking tool defines a transition region that specifies pixels inthe image 190 that have RGB component values included in thesuperellipsoid 650. As shown in the second stage 520, a gray color isdisplayed on the portion of the image 190 (i.e., pixels) that isincluded in the transition region. Some embodiments of the color maskingtool use the superellipsoid 650 to identify the portion of the image 190(i.e., pixels) that is included in the transition region in order forthe media-editing application to display visual indicators (e.g., a graycolor in this example) on the portion of the image 190.

The third state 630 of the three-dimensional color space corresponds tothe third stage 530 illustrated in FIG. 5. As described above, the thirdstage 530 illustrates that the user has moved the slider indicator nearthe right side of the slider control 540 in order to invoke a transitionregion operation that defines a transition region for the color maskbased on the position of the slider indicator on the slider control 540.As mentioned above, some embodiments of the color masking tool define anoffset portion of the three-dimensional color space that encompasses,but does not include, a portion of the three-dimensional color spacedefined for a color mask. As illustrated in the third state 630 of thethree-dimensional RGB color space, the color masking tool has definedsuch an offset portion of the three-dimensional RGB color space based onthe position of the slider indicator on the slider control 540. Similarto the second state 620, the offset portion is a superellipsoid 660,which encompasses, but does not include, the superellipsoid 640 in thisexample. Since the slider indicator is further towards the right on theslider control 540 than illustrated in the second stage 520, whichspecifies a larger transition region, the superellipsoid 660 is largerthan the superellipsoid 650. In some embodiments, the color masking tooldefines the superellipsoid 660 when the media-editing applicationreceives the slider movement of the slider control 540 in the thirdstage 530.

In some embodiments, the color masking tool defines a transition regionfor the color mask based on the superellipsoid 660. For this example,the color masking tool defines a transition region that specifies pixelsin the image 190 that have RGB component values included in thesuperellipsoid 660. As illustrated in the third stage 530, a gray coloris displayed on the portion of the image 190 (i.e., pixels) that isincluded in the transition region. The color masking tool of someembodiments uses the superellipsoid 660 to identify the portion of theimage 190 (i.e., pixels) that is included in the transition region inorder for the media-editing application to display visual indicators(e.g., a gray color in this example) on the portion of the image 190.

While the examples illustrated in FIGS. 1, 3, and 5 each shows aparticular sequence of operations for a color masking operation, othersequences of operations are possible. For example, after the user hasactivated a color masking tool, the user may select any number ofdifferent portions of an image to create a color mask, add colors to acolor mask, and or remove colors from a color mask. Moreover, the usercan apply a color correction operation to the image using the color maskat any time.

FIGS. 1, 3, and 5 each illustrates one arrangement of a GUI of amedia-editing application. However, different embodiments of the GUI ofthe media-editing application can be arranged any number of differentways. For example, in some embodiments, the media-editing applicationmight provide user-selectable UI items and controls in a separatesection or panel of the GUI. Some embodiments of the media-editingapplication may provide a GUI that includes additional and/or other UIelements than those illustrated in FIGS. 1, 3, and 5. For instance, someembodiments provide a user-selectable UI item for allowing a user totoggle between specifying the color mask as an inner color mask or anouter color mask, which are described in further detail below.

Several of the figures described above illustrate one type of selectiontool (a circle with a cross hair in the middle). However, differentembodiments might provide different types of selection tools forselecting a portion of an image (e.g., pixels) in order to create acolor mask (or add or remove colors from an existing color mask). Forinstance, some embodiments of the media-editing application provide aneye dropper selection tool to select a portion of an image. Otherembodiments of the media-editing application may provide other types ofselection tools.

In some embodiments, the media-editing application provides a selectiontool that has a user-adjustable selection area. For example, some ofthese user-adjustable selection tools allow the user to enlarge orshrink the selection tool's selection area (e.g., by performing aclick-and-drag cursor operation on a portion of an image or atouch-and-drag operation on a portion of an image displayed on atouchscreen). This way, the user can more accurately select the colorsin the image that the user wants included in a color mask.

The figures illustrated above describe a color masking tool that definesa color mask that specifies pixels in a image that have the same orsimilar color values as the color values of the pixels in a selectedportion of the image. In some embodiments, when a user invokes a colorcorrection operation, the media-editing application applies the colorcorrection operation to pixels in the image that are included in thecolor mask (also referred to as an inner color mask). However, in someinstances a user might want to apply the color correction operation tothe entire image except for the portion of the image that is included inthe color mask (also referred to as an outer color mask). As such, someembodiments of the color masking tool use the color mask to identifypixels in a image that do not have the same or similar color values asthe color values of the pixels in a selected portion of the image. Insome such embodiments, the media-editing application applies the colorcorrection operation to the image based on the pixels in the imageidentified by the color masking tool.

Some of the figures described above conceptually illustrate athree-dimensional color space in which a color masking tool of someembodiments defines a portion of the three-dimensional color space for acolor mask. However, one of ordinary skill in the art will recognizethat the three-dimensional color space may be represented any number ofdifferent ways. For instance, some embodiments use a three-dimensionalarray to represent the three-dimensional color space.

Although the figures above illustrate different color masking tools(e.g., positive color masking tool, negative color masking tool), insome embodiments, the functionalities of two or more of the colormasking tools are actually included in a single color masking tool. Forexample, some embodiments of the color masking tool include some or allof the features and functions of a positive color masking tool and anegative color masking tool. In some embodiments, the color masking toolincludes positive and negative masking tools and a transition regiontool. Other combinations of color masking tools are possible in otherembodiments.

The examples illustrated above describe creating and adjusting a colormask for a still image. As mentioned above, the color masking tool candefine a color mask for a frame (or field) of a video clip in someembodiments. In some of these embodiments, the color masking tooldefines a color mask for a particular frame of a video clip andassociates the color mask with the rest of the frames in the video clip.For instance, a user may create a color mask for a frame of a video clipand invoke a color correction operation on the frame of the video clip.When the user invokes the color correction operation on the frame, thecolor masking tool of some embodiments applies the color correction tothe frame using the color mask and automatically applies the colorcorrection to each of the other frames in the video clip using the colormask. In this manner, the user only has to create a color mask for oneframe of a video clip (instead of creating a color mask for each frameof the video clip) in order to apply a color correction operation to theentire video clip based on colors in the frames.

Different types of applications may provide a color masking tool. Asdescribed above, some embodiments of a media-editing application (e.g.,Final Cut Prom and iMovie®) provide a color masking tool. In someembodiments, image-editing applications (e.g., Aperture®), imageorganizers, image viewers, or any other type of image applicationsprovide a color masking tool. Furthermore, a color masking tool may beprovided by an operating system of a computing device (e.g., a desktopcomputer, tablet computer, laptop computer, smartphone, etc.) in someembodiments.

Several more detailed embodiments of the invention are described in thesections below. Section I provides further details of defining a colormask in a three-dimensional color space. Next, Section II providesfurther details of manipulating a shape mask of some embodiments.Section III describes an example of a masking tool of some embodimentsthat includes a color masking tool and a shape masking tool whileSection IV describes an example GUI of a media-editing application ofsome embodiments. Section V then describes a software architecture of amedia-editing application of some embodiments. Finally, Section VIdescribes an electronic system that implements some embodiments of theinvention.

I. Color-Based Masks

A. Defining Color Mask

Several of the figures illustrated in the above section described acolor masking tool that defines a color mask for an image by defining asuperellipsoid in a three-dimensional color space (e.g., athree-dimensional RGB color space) based on a selection of a portion ofthe image. Different embodiments define a superellipsoid in athree-dimensional color space differently. For instance, someembodiments of the color masking tool define the superellipsoid in thethree-dimensional color space by using Principal Component Analysis(PCA) in order to define a bounding box that encompasses the pixelvalues in the three-dimensional color space of pixels in the selectedportion of the image. Then, the color masking tool defines thesuperellipsoid based on the bounding box.

FIG. 7 conceptually illustrates a process 700 of some embodiments fordefining a superellipsoid in a three-dimensional color space. In someembodiments, the process 700 is performed by the color masking tool ofsome embodiments when the color masking tool (or the application thatprovides the color masking tool) receives a selection of a portion of animage (i.e., pixels) to create a color mask, to add colors to a colormask, or to remove colors from a color mask (e.g., as illustrated instages 120, 140, 320).

The process 700 will be described by reference to FIGS. 8-10, whichconceptually illustrate various states of a Bounding Color Sample (BCS)coordinate system that is used to define a superellipsoid. Inparticular, FIG. 8 conceptually illustrates three different states810-830 of determining a bounding box in the BCS coordinate system basedon the pixel values illustrated in the third state 230 of thethree-dimensional RGB color space of FIG. 2. FIG. 9 conceptuallyillustrates four different states 910-940 of performing adjustments tothe BCS coordinate system based on the bounding box. FIG. 10conceptually illustrates three different states 1010-1030 of defining asuperellipsoid in the BCS coordinate system based on the bounding box.

As shown, the process 700 begins by identifying (at 710) a set of pixelvalues in a three-dimensional color space. For instance, when the colormasking tool of some embodiments (or the application which provides thecolor masking tool) receives a selection of a portion of an image tocreate a color mask, the color masking tool identifies the set of pixelvalues in the three-dimensional color space that correspond to pixelsincluded in the selected portion of an image. In some embodiments, whenthe color masking tool (or the application which provides the colormasking tool) receives a selection of a portion of an image to addcolors to a color mask, the color masking tool identifies the set ofpixel values in the three-dimensional color space that correspond topixels included in the selected portion of an image as well as thepixels included in the existing color mask. When the color masking toolof some embodiments (or the application which provides the color maskingtool) receives a selection of a portion of an image to remove colorsfrom a color mask, the color masking tool identifies the set of pixelvalues in the three-dimensional color space that correspond to pixelsincluded in the existing color mask, but are not included in theselected portion of an image.

Referring to FIG. 8 as an example, the first state 810 illustrates a setof points plotted in a three-dimensional RGB color space and acorresponding set of points in a BCS coordinate system. Specifically,this set of points is the same set of points shown in the third state230 of a three-dimensional RGB color space of FIG. 2. As describedabove, the third state 230 of the three-dimensional RGB color spacecorresponds to the fourth stage 140 illustrated in FIG. 1. As mentionedabove, the fourth stage 140 illustrates that the user has selected aportion of the right mountain in the image 190 in order to add colors inthe portion of the right mountain to the color mask created in thesecond stage 120. Thus, the set of points illustrated in the first state810 represents the RGB component values of the pixels in the image 190that were selected in the second stage 120 and the fourth stage 140, asillustrated in FIG. 1.

Next, the process 700 performs (at 720) Principal Component Analysis(PCA) on the identified set of pixel values. Generally, PCA is amathematical procedure that uses an orthogonal transformation to converta set of observations (e.g., RGB component values) of possiblycorrelated variables into a set of values of uncorrelated variablescalled principal components. An orthogonal transformation matrix is asquare matrix that includes real entries whose columns and rows areorthogonal unit vectors (i.e., orthonormal vectors). The orthogonaltransformation is defined, in some embodiments, in such a way that thefirst principal component has as high a variance as possible (i.e.,accounts for as much of the variability in the data as possible), andeach succeeding component in turn has the highest variance possibleunder the constraint that it be orthogonal to (uncorrelated with) thepreceding components.

In some embodiments, the process 700 performs PCA on the identified setof pixel values in order to determine three orthogonal axes (e.g., x-,y-, and z-axis) for identifying the orientation of a bounding box (e.g.,a rectangular cuboid) that encompasses the set of pixel values in thethree-dimensional color space. Continuing with the example illustratedin FIG. 8, the left side of the first state 810 also illustrates threeorthogonal x-, y-, and z-axis that were determined by the process 700 asa result of performing PCA on the set of pixel values in thethree-dimensional RGB color space.

As mentioned above, performing PCA on the set of pixel values alsoidentifies a set of transforms (e.g., an orthogonal transformationmatrix) for converting pixel values from the three-dimensional colorspace to a coordinate system (also referred to as a BCS coordinatesystem) in which the color masking tool of some embodiments defines abounding box.

The process 700 then applies (at 730) the set of transforms identifiedby the process 700 performing PCA on the set of pixels to convert theset of pixel values from the three-dimensional color space to acorresponding set of pixel values in the BCS coordinate system. As notedabove, the set of transforms is an orthogonal transformation matrix insome embodiments.

Continuing with the example illustrated in FIG. 8, the right side of thefirst state 810 shows a corresponding set of pixel values in a BCScoordinate system after the process 700 applies an orthonormaltransformation matrix to the set of pixel values in thethree-dimensional RGB color space. For this example, the correspondingset of pixel values in the BCS coordinate system are expressed in termsof x-, y-, and z-coordinate values, as indicated by labels near eachaxis. In this example, the set of transforms that the process 700identifies by applying PCA on the set of identified pixels is anorthonormal transformation matrix. As noted above, an orthogonaltransformation matrix is a square matrix that includes real entrieswhose columns and rows are orthogonal unit vectors. As such, theorthogonal transformation matrix, which is applied to each pixel, mapsthe pixel values in the three-dimensional RGB color space tocorresponding pixel values that range between −1 and 1, as indicated inthe BCS coordinate system.

Next, the process 700 determines (at 740) sides for a bounding box basedon the set of pixel values in the BCS coordinate system in order todefine the bounding box. In some embodiments, the process 700 determinesthe sides for the bounding box based on the maximum (i.e., largest) andminimum (i.e., smallest) coordinate values among the pixel values alongeach of the axes in the BCS coordinate system.

Referring to the first state 810 of FIG. 8, the right side of the firststate 810 additionally illustrates the maximum and minimum coordinatevalues along the y-axis based on the pixel values in the BCS coordinatesystem. The maximum and minimum y-coordinate values are each indicatedby a panel that is positioned perpendicular to the y-axis at thecoordinate value. Thus, the y-coordinate values of each of the pixelvalues in the BCS coordinate system are within the y-coordinate valuesindicated by the panels.

The second state 820 shows the maximum and minimum coordinate valuesalong the x-axis based on the pixel values in the BCS coordinate system.The maximum and minimum x-coordinate values are each indicated by apanel that is positioned perpendicular to the x-axis at the x-coordinatevalue. Therefore, the x-coordinate values of each of the pixel values inthe BCS coordinate system are within the x-coordinate values indicatedby the panels.

The third state 830 is similar to the second state 820, but, instead ofthe x-axis, the third state 830 illustrates the maximum and minimumcoordinate values along the z-axis based on the pixel values in the BCScoordinate system. Likewise, the maximum and minimum z-coordinate valuesare each indicated by a panel that is positioned perpendicular to thez-axis at the z-coordinate value. As such, the z-coordinate values ofeach of the pixel values in the BCS coordinate system are within thez-coordinate values indicated by the panels.

After the process 700 determines the sides for the bounding box, theprocess 700 defines the bounding box based on the determined sides.Referring to FIG. 9, the first state 910 illustrates the bounding boxthat is defined based on the sides determined in FIG. 8. As shown, thebounding box encompasses the set of pixel values in the BCS coordinatesystem, which corresponds to the set of pixel values in thethree-dimensional color space illustrated on the left side of the firststate 810. In some embodiments, the process 700 adjusts (e.g., enlarges)the bounding box by a tolerance factor (e.g., 0.1 percent, 0.4 percent,1 percent) along each axis in order to account for pixel values locatedin the corners of the bounding box that might be excluded when defininga superellipsoid based on the bounding box.

Returning to FIG. 7, the process 700 centers (at 750) the axes of theBCS coordinate system (i.e., the origin) in the center of the boundingbox. In some embodiments, the process 700 determines the center of thebounding box using the maximum and minimum coordinate values along eachaxis (which the process 700 determines in order to define the sides ofthe bounding box in some embodiments). In such embodiments, the process700 determines the center of the bounding box by averaging the maximumand minimum coordinate values along each axis. The resultingx-coordinate, y-coordinate, and z-coordinate values are the coordinatesof the center of the bounding box. To center the origin of the BCScoordinate system in the center of the bounding box, some embodiments ofthe process 700 determine a translation matrix that translates the pixelvalues to corresponding pixel values such that the origin of the BCScoordinate system is positioned in the center of the bounding box. Theseembodiments then apply the translation matrix to each of the pixelvalues in the BCS coordinate system in order to translate the pixelvalues to their corresponding pixel values.

Referring to FIG. 9, the second state 920 illustrates the origin of theBCS coordinate system illustrated in the first state 910 being centeredin the center of the bounding box, as indicated by an arrow. When theorigin of the BCS coordinate system is centered in the center of thebounding box, the center of the bounding box accordingly has x-, y-, andz-coordinates of (0,0,0).

Next, the process 700 scales (at 760) the axes of the BCS coordinatesystem. The process 700 scales each axis of the BCS coordinate system sothat the sides of the bounding box perpendicular to each axis correspondto the ends of a range of values. For instance, some embodiments of theprocess 700 scale each axis of the BCS coordinate system so that thesides of the bounding box perpendicular to each axis correspond to thevalues −1 and 1. The third state 930 of FIG. 9 illustrates an example ofscaling the axes of the BCS coordinate system so that the sidesperpendicular to each axis correspond to such values. As shown in thethird state 930, one of the sides of the bounding box along each axis isadjusted to intersect the axis' coordinate value of −1 (not shown) andthe other side of the bounding box along the axis is adjusted tointersect the axis' coordinate value of 1. In some embodiments, theprocess 700 determines a scaling matrix that scales the pixel values tocorresponding pixel values so that coordinate values along the axes ofthe BCS coordinate system are scaled to the values −1 and 1. Suchembodiments then apply the scaling matrix to each of the pixel values inthe BCS coordinate system to scale the pixel values to theircorresponding pixel values.

The fourth state 940 illustrates the bounding box after the axes of theBCS coordinate system have been scaled as described in the third state930. As shown in the fourth state 940, the pixel values illustrated infirst state 910 have been translated such that the origin of the BCScoordinate system is positioned in the center of the bounding box andscaled such that the sides perpendicular to each axis correspond to thevalues −1 and 1.

Finally, the process 700 determines (at 770) a superellipsoid based onthe bounding box. Generally, a superellipsoid is a solid whosehorizontal sections are superellipses with the same exponent r, andwhose vertical sections through the center are superellipses with thesame exponent t. The surface of a superellipsoid can be defined usingthe following equation:

$\begin{matrix}{1 = {\left( {{x}^{r} + {y}^{r}} \right)^{\frac{t}{r}} + {z}^{t}}} & (1)\end{matrix}$where x, y, and z are coordinates along each axis of a three-dimensionalcoordinate system in which the superellipsoid is defined. In addition, rand t are positive real numbers that control the amount of flattening atthe tips and equator. Different embodiments of the process define thesuperellipsoid in different ways based on the above equation (1). Forinstance, the process of some embodiments defines the superellipsoidusing the following equation:1=|x| ⁴ +|y| ⁴ +|z| ⁴  (2)Some embodiments of the process, instead of using 4 as the exponents ofequation (2), define the surface of the superellipsoid using anothervalue as the exponents of equation (2), such as a value within the rangebetween 2 and 10. A value of 2 as the exponent of equation (2) defines asphere. As the value of the exponent of equation (2) increases from thevalue of 2, the roundness of the corners (i.e., vertices) of thesuperellipsoid decreases. In other words, as the value of the exponentof equation (2) increases from the value of 2 towards infinity, theshape of the superellipsoid changes from an ellipsoid (e.g., arectangular cuboid with very rounded corners) to a rectangular cuboidwith sharp corners (i.e., no roundness). In some embodiments, asuperellipsoid defined by equation (2) may be referred to as arectangular cuboid with vertices that are truncated and rounded. Arectangular cuboid includes other types of cuboids, such as a squarecuboid, a right square prism, and a cube, for example.

Defining the curvature of a superellipsoid involves two competingfactors: inclusiveness of RGB component values in the three-dimensionalRGB color space of selected pixels in the image and smoothness of thesuperellipsoid for the color mask. Defining a superellipsoid with asmall amount of curvature may include the RGB component values in thethree-dimensional RGB color space of all the selected pixels in theimage. However, the defined color mask of such a superellipsoid mayinclude sharp (i.e., not smooth) ranges of colors (i.e., RGB componentvalues in the three-dimensional RGB color space). Defining asuperellipsoid that has more curvature (rounded corners), on the otherhand, allows for the definition of a color mask that includes a smoothrange of colors (i.e., RGB component values in the three-dimensional RGBcolor space). as the corners of the superellipsoid are defined rounder,the superellipsoid may omit RGB component values in thethree-dimensional RGB color space (e.g., near corners of the boundingbox) of some selected pixels in the image. Thus, a superellipsoiddefined with more rounded corners allows for the definition of a colormask that has smoother ranges of colors, but the defined superellipsoidmay not accurately include the selected colors in the image.

Some embodiments of the process may define other types ofthree-dimensional shapes based on the bounding box as well. Forinstance, the process of some embodiments defines rectangular cuboidsthat have rounded corners with different corner radii. For example, sucha rectangular cuboid can be defined to have a very small corner radiussuch that, to the perception of the human eye, the rectangular cuboidappears to have sharp corners. That is, the rectangular cuboid is 99.99%similar to a rectangular cuboid that has sharp ninety degree corners.Mathematically, however, the rectangular cuboid has rounded corners.However, some embodiments of the process allow the rectangular cuboid tobe defined with a corner radius of zero. Additionally, the rectangularcuboid can be defined as a rectangular cuboid with rounded corners thathave a very large corner radius.

The rounded corner of the rectangular cuboid may be defined based on thearc length of a sphere in some embodiments. In some such embodiments,the width, height, and length of each of the rounded corners are equal.Alternatively, some other embodiments may define each of the roundedcorners of the rectangular cuboid with unequal width, height, andlength. For instance, the width, height, and length of the roundedcorners may be defined as proportional to the width, height, and lengthof the rectangular cuboid. In this manner, the rectangular cuboid may bedefined as a rectangular cuboid with a very minimal amount of roundnessso as to appear as a rectangular cuboid with ninety degree corners and arectangular cuboid with rounded corners proportional to the width,height, and length of the rectangular cuboid so as to appear as anellipsoid.

As mentioned above, FIG. 10 conceptually illustrates three differentstates 1010-1030 of defining a superellipsoid in a BCS coordinate systembased on a bounding box. Specifically, FIG. 10 illustrates defining asuperellipsoid in the BCS coordinate system illustrated in FIG. 9 basedon the bounding box that was determined in manner described above byreference to FIG. 9.

The first state 1010 is the same as the fourth state 910 of FIG. 9. Atthe first state 1010, a bounding box has been determined in a BCScoordinate system by the process 700 of some embodiments based on theset of pixel values in the three-dimensional RGB color space illustratedin the first state 810 of FIG. 8, as described above. As shown, thefirst state 1010 shows a set of pixel values in the BCS coordinatesystem, which are the corresponding pixel values of the pixel values inthe three-dimensional RGB color space shown in the first state 810.

The second state 1020 conceptually illustrates a superellipsoid definedusing the above equation (2) in relation to the bounding box. Asdescribed above, the sides perpendicular to each axis correspond to thevalues −1 and 1. As such, the points at which the superellipsoid meetthe bounding box are at those such values (i.e., −1 and 1) along each ofthe axes. The third state 1030 illustrates the defined superellipsoid.

In many of the examples described above, the color masking tool isrequired to identify a portion of an image (i.e., pixels) that isincluded in a color mask in different instances. For example, the colormasking tool of some embodiments identifies a portion of an image thatis included in a color mask when visual indicators of color masks are tobe displayed in the GUIs illustrated in FIGS. 1, 3, and 5. Also, someembodiments of the color masking tool identify a portion of an imagethat is included in a color mask when color corrections are applied tothe image.

FIG. 11 illustrates a process 1100 of some embodiments for identifying aportion of an image that is included in a color mask. Specifically, theprocess 1100 identifies a portion of an image that is included in acolor mask based on a superellipsoid that is defined in a BCS coordinatesystem (e.g., by the process 700 described above by reference to FIG.7). In some embodiments, the process 1100 is performed by color maskingtool to identify a portion of an image on which to display visualindicators of the color mask. The color masking tool performs process1100 to apply a color correction operation to an image using the colormask in some embodiments.

The process 1100 starts by identifying (at 1110) a pixel in an image. Insome embodiments, a color mask has been created for the image (e.g., byreceiving a selection of a portion of the image from which the colormask is defined). In some cases, the color mask has also been modified(e.g., by adding colors to the color mask, removing colors from thecolor mask).

Next, the process 1100 determines (at 1120) pixel values in athree-dimensional color space of pixel. As noted above, differentembodiments may define a color mask in different color spaces. Forinstance, some embodiments define a color mask based on athree-dimensional RGB color space. In these embodiments, the process1100 determines corresponding RGB component values in thethree-dimensional RGB color space for the identified pixel.

The process 1100 then applies (at 1130) a set of transforms to convertthe values of the pixel from the three-dimensional color space to a BCScoordinate system. As described above by reference to the process 700illustrated in FIG. 7, some embodiments define a superellipsoid in athree-dimensional RGB color space by defining the superellipsoid in aBCS coordinate system. In some such embodiments, performing the process700 identifies a set of transforms (e.g., an orthonormal matrix, atranslation matrix, and scaling matrix) for converting pixel values froma three-dimensional RGB color space to a BCS coordinate system. In theseembodiments, the process 1100 applies the set of transforms to convertthe pixel values of the pixel from the three-dimensional color space tocorresponding pixel values (e.g., x-, y-, and z-coordinate values) in aBCS coordinate system.

Next, the process 1100 determines (at 1140) whether the correspondingpixel values in the BCS coordinate system is within the superellipsoiddefined in the BCS coordinate system. As described above, someembodiments define the surface superellipsoid in the BCS coordinatesystem using the above equation (2). In these embodiments, the process1100 determines whether the corresponding pixel values in the BCScoordinate system are within the superellipsoid defined in the BCScoordinate system by applying the pixel values of the pixel (e.g., x-,y-, and z-coordinate values) to the following inequality:1≧|x| ⁴ +|y| ⁴ +|z| ⁴  (3)If the inequality (3) is true, then the process 1100 determines that thecorresponding pixel values in the BCS coordinate system are within thesuperellipsoid. Otherwise, the process 1100 determines that thecorresponding pixel values in the BCS coordinate system are not withinthe superellipsoid.

When the process 1100 determines that the corresponding pixel values inthe BCS coordinate system are within the superellipsoid, the process1100 identifies (at 1150) the pixel as included in the color mask. Thenthe process 1100 continues to operation 1160. When the process 1100determines that the corresponding pixel values in the BCS coordinatesystem are not within the superellipsoid, the process 1100 proceeds tothe operation 1160.

At 1160, the process 1100 determines whether any pixel in the image isleft to process. When the process 1100 determines that there is a pixelin the image left to process, the process 1100 returns to the operation1110 to continue processing any remaining pixels left in the image.Otherwise, the process 1100 ends. After the process 1100 processes allthe pixels in the image, the pixels in the image that the process 1100has identified as being included in the color mask amount to the pixelsin the portion of the image that are included in the color mask.

While FIG. 11 describes a process for identifying a portion of an imagethat is included in a color mask based on pixel values of the pixels ina BCS coordinate system, the process 1100 can be adapted to similarlyidentify a portion of an image that is included in a transition regionof a color mask. In such embodiments, the process 1110 identifies pixelsin the image as being included in the transition region of the colormask by determining whether the pixel values of the pixels are within asuperellipsoid defined for the transition region, but outside asuperellipsoid defined for the color mask.

B. Removing Colors from a Color Mask

As explained in the sections above, some embodiments of the colormasking tool are for creating a color mask and/or adding colors to anexisting color mask. Additionally, as mentioned above, some embodimentsof the color masking tool are for removing colors from an existing colormask. The following section will describe examples and embodiments ofdefining (e.g., redefining) a color mask after colors are removed froman existing color mask.

FIG. 12 conceptually illustrates a process 1200 of some embodiments fordefining a color mask after colors are removed from an existing colormask. In some embodiments, the process 1200 is performed by the colormasking tool of some embodiments when the color masking tool (or theapplication that provides the color masking tool) receives a selectionof a portion of an image to remove colors from a color mask.

The process 1200 will be described by reference to FIGS. 13-15, whichconceptually illustrate various states of a three-dimensional RGB colorspace that is used to define a superellipsoid for a color mask. Inparticular, FIG. 13 conceptually illustrates five different stages1310-1350 of determining a bounding box in the three-dimensional RGBcolor space. FIG. 14 conceptually illustrates four different stages1410-1440 of determining the bounding box in the three-dimensional RGBcolor space. FIG. 15 conceptually illustrates three different stages1510-1530 of defining a superellipsoid in a BCS coordinate system basedon the bounding box determined in FIGS. 13 and 14.

The process 1200 begins by identifying (at 1210) the bounding box of theexisting color mask in the three-dimensional color space. In someembodiments, the process 1200 identifies the bounding box of theexisting color mask based on the bounding box identified for the colormask in a BCS coordinate system (e.g., by the process 700). In suchembodiments, a set of transforms for mapping the bounding box in the BCScoordinate system is applied to the bounding box in the BCS coordinatesystem in order to identify the corresponding bounding box in thethree-dimensional RGB color space.

Referring to FIG. 13, the first stage 1310 illustrates a set of pointsplotted in a three-dimensional RGB color space. In particular, this setof points is the same set of points shown in the second state 420 of athree-dimensional RGB color space of FIG. 4. As described above, thesecond state 420 of the three-dimensional color space corresponds to thesecond stage 320 illustrated in FIG. 3. As mentioned above, the secondstage 320 illustrates that the user has selected the portion of theimage 190 below the right side of the right mountain in order to removecolors from the existing color mask. As such, the set of pointsillustrated in the first stage 1310 represents the RGB component valuesof the pixels in the image 190 that were selected in the second stage120, the fourth stage 140, and the second stage 320. As shown, severalpoints on the right side of the plotted points are grayed out, whichcorrespond to the RGB component values of the pixels in the portion ofthe image 190 that was selected in the second stage 320.

Next, the process 1200 identifies (at 1220) a bounding box that includesthe pixel values of pixels of colors that are to be removed from theexisting color mask. Referring to FIG. 13 as an example, the first stage1310 illustrates a bounding box, which includes the RGB component valuesof pixels in the image that are to be removed from the existing colormask, identified by the process 1200. In some embodiments, the process1200 identifies the bounding box by performing the process 700, which isdescribed above by reference to FIG. 7. The second stage 1320 of FIG. 13illustrates the two bounding boxes without the pixel values for the sakeof clarity.

The process 1200 then identifies (at 1230) sides of the bounding box forthe existing color mask that do not intersect with any side of thebounding box for the pixel values to be removed from existing the colormask. In some embodiments, the process 1200 determines these sides byperforming a process for detecting intersections such as the process1600, which is described in more detail below by reference to FIG. 16.

In FIG. 13, the third through fifth stages 1330-1350 illustrate thesides of the bounding box for the existing color mask, which areindicated by a bolding of the border of each of the sides, that theprocess 1200 has identified as not intersecting with any side of thebounding box for the colors to be removed from the existing color mask.

Next, the process 1200 determines (at 1240) a bounding box based on anidentified side of the bounding box for the existing color mask. In someembodiments, the process 1200 determines a bounding box that includesthe identified side by iteratively increasing the size of the boundingbox in the direction away from the identified face until the boundingbox cannot be increased any further without intersecting a side of thebounding box for the colors to be removed from the existing color space.

Referring to FIG. 14 as an example, the first stage 1410 illustrates theprocess 1200 in the middle of iteratively increasing the size of abounding box that includes an identified face of the bounding box forthe existing color mask. As shown, the size of the bounding box is beingiteratively increased in the direction away from the identified side.The second stage 1420 of FIG. 14 illustrates the bounding box, which isindicated by a bolding of the bounding box's borders, identified by theprocess 1200 for the identified side of bounding box for the existingcolor mask illustrated in the first stage 1410. As shown, the boundingbox cannot be increased any further without intersecting a side of thebounding box for the colors to be removed from the existing color space.

The process 1200 then determines (at 1250) whether the volume of thedetermined bounding box is the largest volume. When the process 1200determines that the volume of the determined bounding box is the largestvolume, the process 1200 identifies (at 1260) the determined boundingbox as the bounding box of the color mask that does not include thecolors that are to be removed. When the process 1200 determines that thevolume of the determined bounding box is not the largest volume, theprocess 1200 proceeds to operation 1270.

Next, the process 1200 determines (at 1270) whether any identified sideof the bounding box for the existing color mask is left to process. Whenthe process 1200 determines that there is an identified side of thebounding box for the existing color mask left to process, the process1200 returns to the operation 1240 to continue processing any remainingidentified sides of the bounding box for the existing color mask.Otherwise, the process 1100 ends.

Referring to FIG. 14, the third and fourth stages 1430 and 1440illustrate the determined bounding boxes that include the other sides ofthe bounding box for the existing color mask that do not intersect thebounding box for the colors to be removed from the color mask. In thisexample, the process 1200 has identified the determined bounding boxillustrated in the second stage 1420 since that determined bounding boxhas the largest volume among the three determined bounding boxes.

Finally, the process 1200 defines (at 1280) a color mask that does notinclude colors that are to be removed from the existing color mask basedon the determined bounding box that the process 1200 determined has thelargest volume. In some embodiments, the color mask is defined using theprocess 700, which is described above by reference to FIG. 7.

Continuing with the example, the first stage 1510 of FIG. 15 illustratesthe determined bounding box that the process 1200 has identified ashaving the largest volume among the other determined bounding boxes withrespect to the bounding box of the exiting color space. The process 1200uses this bounding box to define the color mask that does not includethe colors that are to be removed from the existing color mask. Asmentioned, some embodiments define such a color mask using the process700. The second and third stages 1520 and 1530 illustrate asuperellipsoid defined in a BCS coordinate system according to theprocess 700. The third stage 1530 also shows the correspondingsuperellipsoid defined in the three-dimensional RGB color space for thecolor mask.

FIG. 16 conceptually illustrates a process 1600 of some embodiments fordetecting intersections between two triangles in a three-dimensionalspace. In some embodiments, the process 1600 is performed by the colormasking tool to determine which sides of a bounding box intersect with aside of another bounding box when defining a color mask after colors areremoved from an existing color mask. In this manner, the color maskingtool can determine which sides of the bounding box do not intersect withany side of the other bounding box.

The process 1600 will be described by reference to FIGS. 17 and 18,which conceptually illustrate various states of detecting intersectionsbetween sides of the bounding boxes illustrated in FIG. 13. Inparticular, FIG. 17 conceptually illustrates four different stages1710-1740 of determining sides of the bounding boxes that do notintersect. For the purpose of clarity, the second and third stages 1720and 1730 show the bounding boxes separated. However, the bounding boxesare actually positioned as illustrated in the first stage 1710. FIG. 18conceptually illustrates six different stages 1810-1860 of determiningsides of the bounding boxes that do intersect. Similarly, for thepurpose of clarity, the first through sixth stages 1810-1860 show thebounding boxes separated. However, the bounding boxes are actuallypositioned as illustrated in top section of the first stage 1810.

As shown, the process 1600 starts by determining (at 1610) a set oftriangles for each of a first bounding box and a second bounding box. Insome embodiments, the process 1600 identifies the set of triangles for abounding box by identifying the sides of the bounding box and splittingeach side into two triangles.

Referring to FIG. 17, the first stage 1710 illustrates the first stage1310 illustrated in FIG. 13. As described above, the first stage 1310illustrates a set of points plotted in a three-dimensional RGB colorspace. In particular, this set of points is the same set of points shownin the second state 420 of a three-dimensional RGB color space of FIG.4. As described above, the second state 420 of the three-dimensionalcolor space corresponds to the second stage 320 illustrated in FIG. 3.As mentioned above, the second stage 320 illustrates that the user hasselected the portion of the image 190 below the right side of the rightmountain in order to remove colors from the existing color mask. Assuch, the set of points illustrated in the first stage 1310 representsthe RGB component values of the pixels in the image 190 that wereselected in the second stage 120, the fourth stage 140, and the secondstage 320. As shown, several points on the right side of the plottedpoints are grayed out, which correspond to the RGB component values ofthe pixels in the portion of the image 190 that were selected in thesecond stage 320.

The second stage 1720 illustrates the bounding boxes illustrated in thefirst stage 1710 after the process 1600 has determined the set oftriangles for each of the bounding boxes. In this example, the boundingbox for the existing color mask is referred to as the first bounding boxand the bounding box for the colors to be removed from the existingcolor mask is referred to as the second bounding box.

The process 1600 then identifies (at 1620) a triangle in the firstbounding box and identifies (at 1630) a triangle in the second boundingbox. Next, the process 1600 determines (at 1640) whether the identifiedsides intersect. Different embodiments use different techniques todetermine whether the identified sides intersect. For instance, someembodiments use a fast triangle-triangle intersection test by TomasMöller. Other embodiments may use other techniques as well.

When the process 1600 determines that the identified triangles do notintersect, the process 1600 determines (at 1650) whether any triangle inthe second bounding box is left to process. Referring to FIG. 17, thethird stage 1730 illustrates an example of when two triangles do notintersect. As shown in the third stage 1730, an identified triangle,which is indicated by a bolding of the border of the triangle, in thebounding box for the existing color mask and an identified triangle,which is also indicated by a bolding of the border of the triangle, inthe bounding box for the colors to be removed from the existing colormask do not intersect. As noted above, the bounding boxes are shownseparately for the sake of clarity. When the process 1600 determinesthat there is a triangle in the second bounding box left to process, theprocess 1600 returns to the operation 1630 to process any remainingtriangles in the second bounding box. Otherwise, the process 1600proceeds to operation 1670.

When the process 1600 determines that the identified triangles dointersect, the process 1600 identifies (at 1660) the side of the firstbounding box to which the identified triangle for the first bounding boxbelongs. Then, the process 1600 proceeds to the operation 1670.Referring to FIG. 18, the first through sixth stages 1810-1860illustrate several examples where an identified triangle in the boundingbox for the existing color mask and an identified triangle in thebounding box for the colors to be removed from the existing color maskintersect. As mentioned above, the bounding boxes are shown separatelyfor the sake of clarity. In particular, each pair of triangles thatprocess 1600 identifies as intersecting is followed by a stageillustrating the side of the bounding box for the existing color mask towhich the triangle for the bounding box belong (e.g., stages 1820, 1840,and 1860).

At 1670, the process 1600 determines whether any triangle in the firstbounding box is left to process. When the process 1600 determines thatthere is triangle in the first bounding box left to process, the process1600 returns to the operation 1620 to process any remaining triangles inthe first bounding box against the triangles in the second bounding box.When the process 1600 determines that there is no triangle in the firstbounding box left to process, the process 1600 ends.

C. Defining a Transition Region for a Color Mask

As mentioned above, some embodiments of the color masking tool define anoffset portion of the three-dimensional color space (e.g., a transitionregion) that encompasses, but does not include, the first portion (ormodified first portion) of the three-dimensional color space. The offsetportion of some embodiments is a scaled version of the first portion (ormodified first portion) of the three-dimensional color space. In someembodiments, the offset portion is scaled such that, for each point onthe surface of the offset portion, a distance from the point on thesurface of the offset portion to a corresponding point on the surface ofthe first portion (or modified first portion) is the same distance.

FIG. 19 conceptually illustrates a process 1900 of some embodiments fordefining a transition region for a color mask. In some embodiments, theprocess 1900 is performed by the color masking tool of some embodimentswhen the color masking tool (or the application that provides the colormasking tool) receives a selection of transition region value (e.g.,through a slider control of a GUI).

The process 1900 will be described by reference to FIGS. 20A and 20B,which conceptually illustrates various states of defining a transitionregion in a three-dimensional color space. In particular, FIG. 20Aconceptually illustrates several examples of transition regions definedin a three-dimensional RGB color space. FIG. 20B conceptuallyillustrates two-dimensional views of the defined transition regionsillustrated in FIG. 20A.

The process 1900 begins by receiving (at 1910) a transition regionvalue. In some embodiments, the process 1900 receives the transitionregion value through a GUI of a media-editing application that providesthe color masking tool. For instance, some of these embodiments receivethe transition region value through a slider control, such as the oneillustrated in FIG. 5. Different embodiment define transition regionvalues differently. For example, some embodiments define transitionregion values as a percentage of the bounding box used to define thesuperellipsoid for the color mask while other embodiments definetransition region values as an offset value.

Next, the process 1900 adjusts (at 1920) the bounding box used to definethe superellipsoid for the color mask by the transition region value. Insome embodiments, the process 1900 adjusts a copy of the bounding boxused to define the superellipsoid for the color mask in order topreserve the bounding box for the color mask. The process 1900 of someembodiments adjusts the bounding box for the transition region byscaling the bounding box such that each side of the bounding box for thetransition region is offset a same amount from the corresponding side ofthe bounding box for the color mask. The amount of the offsetcorresponds to the transition region value in some embodiments. Forexample, some embodiments scale by a larger offset amount as thetransition region value increases and scale by a smaller offset amountas the transition region value decreases.

Finally, the process 1900 defines (at 1930) a superellipsoid for atransition region of the color mask based on the adjusted bounding box.Some embodiments of the process 1900 define the superellipsoid for thetransition region of the color mask based on an equation that is similarto the above equation (2). As mentioned above, the superellipsoid forthe transition region is a scaled version of the superellipsoid in thethree-dimensional color space defined for the color mask and the offsetportion is scaled so that, for each point on the surface of the offsetportion, a distance from the point on the surface of the offset portionto a corresponding point on the surface of the portion defined for thecolor mask is the same distance.

As noted above, FIG. 20A illustrates several examples of bounding boxesdefined in a three-dimensional RGB color space from which transitionregions are defined in the three-dimensional RGB color space.Specifically, FIG. 20A illustrates three states 2010-2030 of thethree-dimensional RGB color space in which different bounding boxes aredefined from which transition regions are defined. In addition, thesedifferent transition regions are defined for the color mask defined inthe fifth stage 150 of FIG. 1. Each of the three states 2010-2030 alsoillustrates an enlarged version of the bounding box defined for thecolor mask and the bounding box defined for the transition region of thecolor mask.

The first state 2010 illustrates the three-dimensional RGB color spacewithout a transition region defined for the color mask. In particular,the first state 2010 illustrates the three-dimensional RGB color spacein the same state as the four state 240 illustrated in FIG. 2.

The second state 2020 illustrates a transition region defined in thethree-dimensional RGB color space. As shown in the enlarged version ofthe bounding boxes, each side of the bounding box for the transitionregion is scaled by an offset amount, d1, from the corresponding side ofthe bounding box for the color mask.

The third state 2030 illustrates another transition region defined inthe three-dimensional RGB color space. The third state 2030 similarlyshows an enlarged version of the bounding boxes, except each side of thebounding box for the transition region is scaled by a larger offsetamount, d2, from the corresponding side of the bounding box for thecolor mask.

FIG. 20A illustrates transition regions, in a three-dimensional RGBcolor space, with sides that are offset an equal amount from thecorresponding sides of a bounding box. To illustrate the equal offset ofthe transition regions from the bounding box in more detail, FIG. 20Bconceptually illustrates two-dimensional views of the defined transitionregions illustrated in FIG. 20A. Specifically, FIG. 20B showstwo-dimensional views of one of the sides of the transition regions andbounding box illustrated in states 2020 and 2030 of FIG. 20A.

As shown, the two-dimensional view of one of the sides of the transitionregion and the bounding box in the state 2020 is shown in the upperportion of FIG. 20B. The solid rectangle corresponds to a side of thebounding box and the dashed rectangle corresponds to the correspondingside of the transition region. As illustrated in FIG. 20B, each side ofthe transition region is offset an amount d1 from the corresponding sideof the bounding box in the state 2020.

FIG. 20B also illustrates the two-dimensional view of one of the sidesof the transition region and the bounding box in the state 2030 in thelower portion of FIG. 20B. Similarly, the solid rectangle corresponds toa side of the bounding box and the dashed rectangle corresponds to thecorresponding side of the transition region. As shown, each side of thetransition region is offset an amount d2 from the corresponding side ofthe bounding box in the state 2030.

As explained above, some embodiments of the color masking tool define acolor mask for a particular frame of a video clip and associates thecolor mask with the rest of the frames in the video clip. Similarly, atransition region defined for the color mask is also associated with therest of the frames in the video clip in some of these embodiments. Forinstance, a user may create a color mask for a frame of a video clip,define a transition region for the color mask, and invoke a colorcorrection operation on the frame of the video clip. When the userinvokes the color correction operation on the frame, the color maskingtool of some embodiments applies the color correction to the frame usingthe color mask and the transition region, and automatically applies thecolor correction to each of the other frames in the video clip using thecolor mask and the transition region.

D. Image Processing

When using the color mask to apply a color correction operation to aportion of an image, sharp cutoffs may exist between pixels that havecolors included in the color mask (to which the color correctionoperation is applied) and pixels that have colors that are similar tothe pixels included in the color mask, but are not included in the colormask (to which the color correction operation is not applied). As such,some embodiments of the color masking tool define a transition regionfor the color mask to smooth out such sharp cutoffs.

As described above, the transition region of some embodiments specifiesa set of pixels in the image that has color values that are similar tothe color values of the pixels included in the color mask, but is notincluded in the color mask. Pixels in the image that are included in thetransition region are partially selected pixels and pixels in the imagethat are included in the color mask are fully selected pixels, in someembodiments. Accordingly, a color correction operation that is appliedto the image is fully applied to fully selected pixels and partiallyapplied to partially selected pixels. In this fashion, the transitionbetween pixels in the image to which the color correction operation isapplied and pixels in the image to which the color correction operationis not applied is smoothed. The following FIG. 21 will describe anexample GUI of a media-editing application that provides a color maskingtool of some embodiments.

FIG. 21 conceptually illustrates a GUI 2100 of a media-editingapplication that provides a color masking tool of some embodiments. Inparticular, FIG. 21 illustrates the GUI 2100 at six stages 2105-2130 ofa color masking operation of the color masking tool that defines atransition region for a color mask. As described above, the GUI 2100includes an image display area 2165 and an adjustments panel 2170.

The image display area 2165 is for displaying a still image or a framein a video clip. The adjustments panel 2170 allows a user of themedia-editing application to activate color correction tools forperforming color correction operations on the image or frame of themedia clip. As shown, the adjustments panel 2170 includes auser-selectable UI item 2140 for activating a color masking tool of someembodiments, a user-selectable UI item 2150 for activating a color boardtool for adjusting colors of pixels in the image, and a user-adjustableslider control 2160 for adjusting a transition region for a color mask.

The slider control 2160 is a conceptual illustration of one or more UIitems that allows a transition region operation to be invoked (e.g., bya cursor operation such as clicking a mouse button and dragging themouse, tapping a touchpad and dragging across the touchpad, or touchingthe slider control displayed on a touchscreen and dragging across thetouchscreen). When the transition region operation is invoked, the colormasking tool defines a transition region for a color mask based on theposition of the slider indicator on the slider control 2160. In someembodiments, different positions of the slider indicator along theslider control 2160 corresponds to different transition region values(e.g. offset values).

Different embodiments of the user-adjustable slider control 2160 definethe position of the slider indicator along the slider control 2160differently. In the following example, the leftmost position on theslider control 2160 does not define a transition region. However, insome embodiments of the slider control 2160, the leftmost position onthe slider control 2160 specifies a default transition region. As theposition on the slider control 2160 moves from left to right, thetransition region increases.

Different embodiments implement the slider control 2160 differently.Some such embodiments implement the slider control 2160 as a textbox (inwhich a user can input values that correspond to the size of thetransition region) while other embodiments implement the slider control2160 as a menu selection command that can be selected through apull-down, a drop-down, or a pop-up menu. Still other embodimentsimplement the slider control 2160 as a keyboard command that can beinvoked through one or more keystrokes or a series of keystrokes. Yetother embodiments allow the user to invoke the transition regionoperation through two or more of such UI implementations or other UIimplementations.

The operation of the GUI 2100 will now be described by reference to thestate of this GUI 2100 during the six different stages 2105-2130 thatare illustrated in FIG. 21. The first stage 2105 illustrates that a userhas activated the color masking tool by selecting the user-selectable UIitem 2140 (e.g., by performing a cursor operation such as clicking amouse button, tapping a touchpad, or touching a touchscreen). As shownin the first stage 2105, the image display area 2165 displays an imageof two children.

The second stage 2110 illustrates the GUI 2100 after a color mask hasbeen created based on the portion of the image selected using aselection tool 2145. In this example, the user has selected a portion ofone of the children's shirts with the selection tool 2145 to create acolor mask. As such, the portion of the image (i.e., pixels) displayedin the image display area 2165 that is specified as being included inthe color mask is indicated by a highlighting of the portion in order toprovide the user with a visual indication of the portion of the imagethat is included in the color mask. In particular, the shirts of the twochildren and various other regions of the image that have the same orsimilar color as the shirts are highlighted. In some embodiments, themedia-editing application displays the highlighting after themedia-editing application defines the color mask.

The third stage 2115 illustrates that the user has activated the colorboard tool of some embodiments by selecting the user-selectable UI item2150 (e.g., by performing a cursor operation such as clicking a mousebutton, tapping a touchpad, or touching a touchscreen). As shown, thethird stage 2115 displays color board 2175 for adjusting colors of thepixels in the image. In some embodiments, when the media-editingapplication receives the selection of the UI item 2150, themedia-editing application displays the color board 2175 in theadjustments panel 2170.

As illustrated in the third stage 2115, the color board 2175 includesseveral sliders that can be movably positioned within the color board2175 to adjust colors of pixels in the image. Different locations on thecolor board 2175 correspond to different colors. In this example, thecolor board includes a slider 2155 for adjusting the colors of allpixels in the image.

The fourth stage 2120 illustrates that the user has positioned theslider 2155 in the lower right hand corner of the color board 2175. Inthis example, that portion of the color board 2175 corresponds to a redcolor. Accordingly, the pixels in the image that are included in thecolor mask (i.e., the shirts of the two children and various otherregions of the image that have the same or similar color as the shirts)are adjusted to the color of the pixels with the corresponding redcolor.

The fifth stage 2125 illustrates that the user has moved the sliderindicator of the slider control 2160 to the middle of the slider control2160 (e.g., by performing a cursor operation such as clicking a mousebutton and dragging the mouse, tapping a touchpad and dragging acrossthe touchpad, or touching the slider control displayed on a touchscreenand dragging across the touchscreen) in order to invoke a transitionregion operation. In some embodiments, the color masking tool definesthe transition region when the media-editing application receives themovement of the slider indicator on the slider control 2160.

Additionally, the fifth stage 2125 illustrates that a transition regionfor the color mask has been defined based on the position of the sliderindicator on the slider control 2160. In this example, the transitionregion includes pixels in the image that are similar to the color of thepixels included in the color mask, but are not included in the colormask. When the transition region has been defined, the media-editingapplication of some embodiments applies the color adjustment illustratedin the fourth stage 2120 to pixels in the image that were not includedin the color mask, but are now included in the transition region.

The sixth stage 2130 illustrates that the user has moved the sliderindicator near the right side of the slider control 2160 (e.g., byperforming a cursor operation such as clicking a mouse button anddragging the mouse, tapping a touchpad and dragging across the touchpad,or touching the slider control displayed on a touchscreen and draggingacross the touchscreen) and that the transition region for the colormask has been redefined based on the position of the slider indicator onthe slider control 2160.

In the sixth stage 2130, the transition region defined in the fifthstage 2125 has increased. That is, the transition region now includespixels in the image that are similar to the color of the pixels includedin the color mask and the transition region defined in the fifth stage2125, but are not included in the color mask and the transition regiondefined in the fifth stage 2125. When the transition region has beenredefined, the media-editing application of some embodiments applies thecolor adjustment illustrated in the fourth stage 2120 to pixels in theimage that were not included in the color mask and the transition regiondefined in the fifth stage 2125, but are now included in the transitionregion.

II. Shape Mask

Some embodiments of the invention provide a novel shape masking tool fora media-editing application. The shape masking tool of some embodimentsprovides a shape mask for identifying a region in an image. In someembodiments, a shape mask is a manipulatable two-dimensional shape thatis displayed over the image in order to identify the region in the imagethat is within the two-dimensional shape. In other words, the shape maskis for identifying pixels in the image that are located within thetwo-dimensional shape. Some embodiments of the shape masking tool applycolor correction operations (e.g., invoked by a user through selectionof a GUI item provided by the media-editing application) to the regionin the image by using the shape mask to isolate pixels in the image thatare located within the shape mask and applying color correctionoperations (e.g., hue adjustments, saturation adjustments, brightnessadjustments, etc.) to the isolated pixels.

The shape masking tool of some embodiments allows a user of the shapemasking tool to manipulate the shape mask into a plethora of differentshapes and sizes. This way, the user may use a single masking tool toidentify a variety of different regions (e.g., faces, buildings, people,etc.) of different shapes and sizes in an image. Different embodimentsof the shape masking tool allow the user to manipulate the shape mask indifferent ways. For instance, some embodiments allow the user to adjustthe shape of a shape mask, adjust the curvature of a shape mask, adjustthe size of a shape mask, and move the shape mask with respect to theimage. Other embodiments may allow the user to adjust the shape mask inadditional and/or different ways as well.

In some embodiments, the shape masking tool provides a set ofuser-selectable GUI controls, which is displayed along with the shapemask over an image, for performing manipulations to the shape mask. Theset of GUI controls includes, in some of these embodiments, GUI controlsfor adjusting the shape of the shape mask, GUI controls for adjustingthe curvature of the shape mask, GUI controls for adjusting the size ofthe shape mask, and GUI controls for moving the shape mask with respectto the image.

Some embodiments of the shape masking tool provide a shape mask that isfor identifying a first region and a second region in an image. Theshape mask of some of these embodiments is a pair of differently-sized,manipulatable, concentric, and two-dimensional shapes that is displayedover the image in order to identify the first and second regions in theimage. In some embodiments, the smaller shape of the shape mask (alsoreferred to as an inner shape) is for identifying the first region inthe image, and the larger shape of the shape mask (also referred to asan outer shape) is for identifying the second region in the image (e.g.,a transition region of the shape mask). Specifically, the shape maskingtool identifies pixels in the image that are within the inner shape aspixels included in the first region of the image, and identifies pixelsin the image that are within the outer shape but outside the inner shapeas pixels included in the second region of the image.

Some embodiments of the shape mask that is for identifying the first andsecond regions in an image allow the user to manipulate the shape maskin a similar manner described above (e.g., adjusting the shape of theshape mask, adjusting the curvature of the shape mask, adjusting thesize of the shape mask, and moving the shape mask with respect to theimage). In some of these embodiments, manipulating the inner shape(e.g., adjusting the size of the inner shape, adjusting the shape of theinner shape, adjusting the curvature of the inner shape) causes acorresponding manipulation of the outer shape of the shape mask, andmanipulating the outer shape (e.g., adjusting the size of the innershape, adjusting the shape of the inner shape, adjusting the curvatureof the inner shape) causes a corresponding manipulation of the innershape of the shape mask. However, some manipulations to the outer shapeof the shape (e.g., scaling the outer shape), in some embodiments, mayhave no affect on the inner shape of the shape mask.

In some embodiments, the inner shape of the shape mask is for indicatingpixels that are within the inner shape as fully selected pixels, and theouter shape of the shape mask is for indicating pixels that are withinthe outer shape but outside the inner shape as partially selectedpixels. The shape mask of these embodiments is also referred to as aninner mask. Some embodiments indicate pixels that are outside the outershape of the shape mask as fully selected pixels, and indicate pixelsthat are inside the outer shape of the shape mask but outside the innershape of the shape mask as partially selected pixels. The shape mask ofthese embodiments is referred to as an outer mask. In some embodiments,when color correction operations are applied to the image, the colorcorrection operation is fully applied to pixels that are fully selected,and the color correction operation is partially applied to pixels thatare partially selected so that a smooth transition exists between pixelsin the image to which the color correction operation is applied andpixels in the image to which the color correction operation is notapplied.

A. Shape Mask Controls

i. Invoking a Shape Masking Tool

FIG. 22 conceptually illustrates a graphic user interface (GUI) 2200 ofa media-editing application of some embodiments that provides a shapemasking tool. Specifically, FIG. 22 illustrates an invocation of theshape masking tool through three stages 2212-2216 of the GUI 2200.

As shown in FIG. 22, the GUI 2200 includes an image display area 2218for displaying an image for a user to edit with a set of editing tools(not shown) and an adjustments panel 2220 that includes a set ofuser-selectable user interface (UI) items. The image display area 2218is displaying an image 2224 and the adjustments panel 2220 includes auser-selectable UI item 2222 for invoking the shape masking tool of someembodiments, as illustrated in FIG. 22.

The user-selectable UI item 2222 is a conceptual illustration of one ormore UI items that allows a shape masking tool to be invoked (e.g., by acursor operation such as clicking a mouse button, tapping a touchpad, ortouching a touchscreen). When the shape masking tool is invoked, someembodiments provide a shape mask (also referred to as a matte shape)with which a user can identify a region of an image displayed in theimage display area 2218. As mentioned above, a shape mask of someembodiments is a manipulatable two-dimensional shape that is displayedover an image in order to identify a region in the image.

Different embodiments implement the UI item 2222 differently. Someembodiments implement the UI item 2222 as a UI button while otherembodiments implement the UI item 2222 as a menu selection command thatcan be selected through a pull-down, a drop-down, or a pop-up menu.Still, other embodiments implement the UI item 2222 as a keyboardcommand that can be invoked through one or more keystrokes or a seriesof keystrokes. Yet other embodiments allow the user to invoke the shapemasking tool through two or more of such UI implementations or other UIimplementations.

An example operation to invoke the shape masking tool will now bedescribed by reference to the three different stages 2212-2216 of theGUI 2200. The first stage 2212 illustrates the image 2224 displayed inthe display area 2218. In some embodiments, the media-editingapplication displays the image 2224 in the image display area 2218 whenthe media-editing application receives a selection (e.g., through akeyboard command(s) or a cursor operation) of a representation of theimage 2224 in another region (not shown) of the media-editingapplication (e.g., a file browser, an event library, a compositingdisplay area, etc.). In some embodiments, the image 2224 may be a stillimage, an image (frame or field) of a video, or any other type of image.In this example, the image 2224 is a still image. As shown, the image2224 is of two children in the foreground and several lampposts and abuilding in the background.

The second stage 2214 of the GUI 2200 illustrates a user invoking theshape masking tool by selecting the UI item 2222 using a cursor (e.g.,by clicking a mouse button, tapping a touchpad, or touching atouchscreen). In this example, the selection of the UI item 2222 isindicated by a highlighting of the UI item 2222.

In the third stage 2216 of the GUI 2200, the user has completed theinvocation of the shape masking tool. The third stage 2216 shows a shapemask 2244 displayed near the middle of the image 2224. In someembodiments, the media-editing application displays the shape mask 2244when the media-editing application receives the selection of the UI item2222. As shown in this example, the shape masking tool provides theshape mask 2244 in the form of a circle when the shape masking tool isinvoked. However, different embodiments of the shape masking tool mayprovide different superellipse shapes as the default shape for the shapemask 2244 when the shape masking tool is invoked.

As shown, the shape mask 2244 includes an inner shape 2226, auser-selectable outer shape 2228, and seven user-selectable shape maskcontrols 2230-2242. As mentioned above, some embodiments of the shapemasking tool provide a shape mask that is for identifying first andsecond regions in an image. The shape mask 2244 is an example of such ashape masking tool. The inner shape 2226 is for identifying a firstregion and the outer shape 2228 is for identifying a second region(e.g., a transition region of the shape mask) in the image 2224.Specifically, the inner shape 2226 is for identifying pixels in theimage 2224 that are within the inner shape 2226 and the outer shape 2228is for identifying pixels in the image 2224 that are within the outershape 2228 but outside the inner shape 2226.

In some embodiments, the user-selectable shape mask controls 2228-2242of the shape mask 2244 are each for manipulating the shape mask 2244. Inthis example, the user-selectable shape mask control 2230 is for movingthe shape mask 2244 within the image display area 2218, theuser-selectable shape mask controls 2234-2240 are each for adjusting thesize and shape of the shape mask 2244, the user-selectable shape maskcontrol 2242 is for adjusting the curvature of the shape mask 2244, theuser-selectable shape mask control 2232 is for rotating the shape mask2244, and the user-selectable outer shape 2228 is for adjusting atransition region of the shape mask 2244. The following sections willdescribe example operations of each of the shape mask controls 2228-2242to illustrate some of the different ways that a shape mask of someembodiments can be manipulated.

ii. Moving a Shape Mask

As mentioned above, some embodiments of the shape masking tool provide ashape mask that allows a user to move the shape from one location in animage display area to another location in the image display area.Different embodiments provide different techniques for moving the shapemask within the image display area. FIG. 23 illustrates one approach formoving the shape mask within the image display area. Specifically, FIG.23 illustrates an example operation of moving the shape mask 2244through the image display area 2218 of the GUI 2200 at four differentstages 2312, 2314, 2316, and 2318.

The first stage 2312 is identical to the third stage 2216 of FIG. 22. Asshown, the shape mask 2244 is displayed near the middle of the image2224 away from the children's faces. As mentioned above, someembodiments of the media-editing application display the shape mask 2244when the shape masking tool is invoked (e.g., by selecting the UI item2222 as illustrated in FIG. 22).

The second stage 2314 of the GUI 2200 illustrates that the user hasinitiated a movement of the shape mask 2244 by selecting theuser-selectable shape mask control 2230 using a cursor (e.g., byclicking a mouse button, tapping a touchpad, or touching a touchscreen).The selection of the shape mask control 2230 is indicated by displayingan enlarged version of the shape mask control 2230. In some embodiments,the media-editing application displays the enlarged version of the shapemask control 2230 when the media-editing application receives theselection of the shape mask control 2230.

In the third stage 2316, the user has started to move the shape mask2244 by moving the cursor (e.g., by moving a mouse across a surface,dragging a finger across a touchpad, or dragging a finger across atouchscreen) toward the right bottom corner of the image display area2218, as indicated by arrow 2320. Arrow 2322 shows that the movement ofthe cursor has caused the shape mask 2244 to move toward the children'sfaces in the image 2224. In some embodiments, the media-editingapplication moves the shape mask 2244 when the media-editing applicationreceives the movement input of the cursor.

The fourth stage 2318 illustrates the GUI 2200 after the user hascompleted the move operation of the shape mask 2244. In this example,the user completes the move operation (e.g., by releasing a mousebutton, lifting a finger off a touchpad, or lifting a finger off atouchscreen) when the shape mask 2244 is in a desired location. As aresult of this operation, the shape mask 2244 is located at a positionin the image 2224 such that the shape mask 2244 encompasses thechildren's faces. Also, the original version of the shape mask control2230 (which is illustrated in the first stage 2312) is displayed in theGUI 2200 at the fourth stage 2318. In some embodiments, themedia-editing application displays the original version of the shapemask control 2230 when the media-editing application receives a commandindicating that the move operation is completed (e.g., by releasing amouse button, lifting a finger off a touchpad, or lifting a finger off atouchscreen).

iii. Adjusting Dimensions of a Shape Mask

In addition to moving a shape mask, the shape masking tool of someembodiments provides a shape mask that allows a user of themedia-editing application to adjust the shape of the shape mask alongone dimension of the shape mask. FIG. 24 illustrates example operationsof adjusting the shape of the shape mask 2244 along a dimension of theshape mask 2244 through the image display area 2218 of the GUI 2200 atsix different stages 2412, 2414, 2416, 2418, 2420, and 2422. The firstfour stages 2412-2418 illustrate the operation of expanding the shape ofthe shape mask 2244 along a dimension of the shape mask 2244 and thelast two stages 2420-2422 illustrate the operation of shrinking theshape of the shape mask 2244 along the dimension of the shape mask 2244.

The first stage 2412 continues from the last stage 2318 of FIG. 23. Asshown, the first stage 2412 is identical to the fourth stage 2318 ofFIG. 23. In the first stage 2412, the shape mask 2244 is displayed overand is encompassing the two children's faces.

The second stage 2414 of the GUI 2200 illustrates that the user hasinitiated an adjustment of the shape of the shape mask 2244 along adimension of the shape mask 2244 by selecting the user-selectable shapemask control 2234 using a cursor (e.g., by holding down a mouse button,tapping a touchpad, or touching a touchscreen). As shown, an enlargedversion of the shape mask control 2234 is displayed to indicate theselection of the user-selectable shape mask control 2234. In someembodiments, the media-editing application displays the enlarged versionof the shape mask control 2234 when the media-editing applicationreceives the selection of the shape mask control 2234.

In the third stage 2416, the user has started to expand the shape of theshape mask 2244 along the dimension of the shape mask 2244 by moving thecursor away and upward from the center of the shape mask 2244, asindicated by the arrow 2424. As indicated by the arrows 2426 and 2428,the movement of the cursor has caused the shape of the shape mask 2244to expand in a vertical direction. In some embodiments, themedia-editing application expands the shape of the shape mask 2244 alongthe dimension of the shape mask 2244 when the media-editing applicationreceives the movement of the cursor in a direction away from the centerof the shape mask 2244.

The fourth stage 2418 shows the GUI 2200 after the user has completedexpanding the shape of the shape mask 2244 along the dimension of theshape mask 2244. As shown in the fourth stage 2418, the shape mask 2244has been vertically elongated. In addition, the original version of theshape mask control 2234 (which is illustrated at the first stage 2412)is displayed in the GUI 2200 at the fourth stage 2418. In someembodiments, the media-editing application displays the original versionof the shape mask control 2234 when the media-editing applicationreceives a command indicating that the dimension adjustment operation iscompleted (e.g., by releasing a mouse button, lifting a finger off atouchpad, or lifting a finger off a touchscreen).

In the fifth stage 2420, the user has initiated another adjustment ofthe shape of the shape mask 2244 along the dimension of the shape mask2244 by selecting the user-selectable shape mask control 2234 using thecursor (e.g., by holding down a mouse button, tapping a touchpad, ortouching a touchscreen). Similar to the third stage 2416, an enlargedversion of the shape mask control 2234 is displayed to indicate theselection of the user-selectable shape mask control 2234. Themedia-editing application of some embodiments displays the enlargedversion of the shape mask control 2234 when the media-editingapplication receives the selection of the shape mask control 2234.

The sixth stage 2422 illustrates the GUI 2200 after the user hasadjusted the shape of the shape mask 2244 along the dimension of theshape mask 2244. As illustrated in the sixth stage 2422, the user hasadjusted the shape of the shape mask 2244 along the same dimension ofthe shape mask 2244 as that illustrated in the stages 2414-2418 exceptthe user has adjusted the shape of the shape mask 2244 in the oppositedirection in order to vertically shorten the shape of the shape mask2244. The sixth stage 2422 also shows the original version of the shapemask control 2234 (which is illustrated at the first stage 2412)displayed in the GUI 2200. Some embodiments of the media-editingapplication display the original version of the shape mask control 2234when the media-editing application receives a command indicating thatthe dimension adjustment operation is completed (e.g., by releasing amouse button, lifting a finger off a touchpad, or lifting a finger off atouchscreen).

FIG. 24 illustrates example operations of adjusting the shape of theshape mask 2244 along one dimension of the shape mask 2244. Someembodiments also allow the user to adjust the shape of the shape mask2244 along another dimension of the shape mask 2244. FIG. 25 illustratesan example operation of adjusting the shape of the shape mask 2244 alonganother dimension of the shape mask 2244 through the image display area2218 of the GUI 2200 at three different stages 2512, 2514, and 2516.

The first stage 2512 continues from the last stage 2422 of FIG. 24. Asshown, the first stage 2512 is similar to the sixth stage 2422 of FIG.24, except the first stage 2512 illustrates that the user has initiatedan adjustment of the shape of the shape mask 2244 along anotherdimension of the shape mask 2244 by selecting the shape mask control2236 using a cursor (e.g., by holding down a mouse button, tapping atouchpad, or touching a touchscreen). The selection of the shape maskcontrol 2236 is indicated by displaying an enlarged version of the shapemask control 2236. In some embodiments, the media-editing applicationdisplays the enlarged version of the shape mask control 2236 when themedia-editing application receives the selection of the shape maskcontrol 2236.

In the second stage 2514, the user has started to adjust the shape ofthe shape mask 2244 along the other dimension of the shape mask 2244 bymoving the cursor away and to the right from the center of the shapemask 2244, as indicated by the arrow 2518. As indicated by the arrows2520 and 2522, the movement of the cursor has caused the shape of theshape mask 2244 to expand along the other dimension of the shape mask2244. In some embodiments, the media-editing application expands theshape of the shape mask 2244 along the other dimension of the shape mask2244 when the media-editing application receives the movement of thecursor in a direction away from the center of the shape mask 2244.

The third stage 2516 illustrates the GUI 2200 after the user hasexpanded the shape of the shape mask 2244 along the other dimension ofthe shape mask 2244. As illustrated in the third stage 2516, the shapeof the shape mask 2244 has been horizontally elongated. Additionally,the third stage 2516 shows the original version of the shape maskcontrol 2236 (which is illustrated at the first stage 2412) displayed inthe GUI 2200. In some embodiments, the media-editing applicationdisplays the original version of the shape mask control 2236 when themedia-editing application receives a command indicating that thedimension adjustment operation is completed (e.g., by releasing a mousebutton, lifting a finger off a touchpad, or lifting a finger off atouchscreen).

FIGS. 24 and 25 illustrate a shape mask of some embodiments that allowsa user to individually adjust the shape of the shape mask along twoorthogonal dimensions. However, some embodiments of the shape maskingtool may provide a shape mask that allows the user to concurrentlyadjust the shape of the shape mask along the two orthogonal dimensionsof the shape mask. For example, some of these embodiments might providea user-selectable shape mask control similar to the shape mask controls2234-2240 between each adjacent pair of the shape mask controls2234-2240. In some such embodiments, the user can use these additionalcontrols to simultaneously adjust the shape of the shape mask along thetwo orthogonal dimensions of the shape mask illustrated in FIGS. 24 and25. In addition, the shape masking tool of some embodiments may providea shape mask that allows the user to adjust the shape of the shape maskalong additional and/or different dimensions of the shape mask.

iv. Scaling the Shape Mask

As explained above, the shape mask of some embodiments allows a user toadjust the shape of the shape mask along one or more dimensions of theshape mask. However, in some cases, the user may wish to uniformlyadjust the size of (i.e., scale) the shape mask. FIG. 26 illustratesexample operations of uniformly scaling a shape mask through the imagedisplay area 2218 of the GUI 2200 at five different stages 2612, 2614,2616, 2418, and 2620. The first three stages 2612-2616 illustrate theoperation of uniformly increasing the size of the shape mask 2244 andthe last two stages 2618-2620 illustrate the operation of uniformlydecreasing the size of the shape mask 2244.

The first stage 2612 continues from the last stage 2516 of FIG. 25. Asshown, the first stage 2612 is similar to the third stage 2516 of FIG.25, except the first stage 2612 illustrates that the user has initiateda scaling operation by holding down a hot key (e.g., a shift key) whileselecting the user-selectable shape mask control 2234 using a cursor(e.g., by holding down a mouse button, tapping a touchpad, or touching atouchscreen). The selection of the shape mask control 2234 is indicatedby displaying an enlarged version of the shape mask control 2234. Themedia-editing application of some embodiments displays the enlargedversion of the shape mask control 2234 when the media-editingapplication receives the selection of the shape mask control 2234 whilethe hot key is held down.

In the second stage 2614, the user has started to scale the size of theshape mask 2244 by moving the cursor away from the center of the shapemask 2244, as indicated by the arrow 2622. As indicated by the arrows2624-2630, the movement of the cursor has caused the size of the shapemask 2244 to uniformly increase.

The third stage 2616 illustrates the GUI 2200 after the user hascompleted scaling the size of the shape mask 2244. As shown, the size ofthe shape mask 2244 has been uniformly increased. In addition, theoriginal version of the shape mask control 2234 (which is illustrated atthe third stage 2516 of FIG. 25) is displayed at the sixth stage 2616.In some embodiments, the media-editing application displays the originalversion of the shape mask control 2234 when the media-editingapplication receives a command indicating that the scaling operation iscompleted (e.g., by releasing a mouse button, lifting a finger off atouchpad, or lifting a finger off a touchscreen).

In the fourth stage 2618, the user has initiated another scalingoperation of the shape mask 2244 by holding down a hot key (e.g., ashift key) while selecting the user-selectable shape mask control 2234using the cursor (e.g., by holding down a mouse button, tapping atouchpad, or touching a touchscreen). As shown, the selection of theshape mask control 2234 is indicated by displaying of an enlargedversion of the shape mask control 2234. In some embodiments, themedia-editing application displays the enlarged version of the shapemask control 2234 when the media-editing application receives theselection of the shape mask control 2234 while the hot key is held down.

The fifth stage 2620 shows the GUI 2200 after the user has completedscaling the size of the shape mask 2244. As shown, the size of the shapemask 2244 has been uniformly decreased. The original version of theshape mask control 2234 (which is illustrated at the third stage 2516 ofFIG. 25) is displayed at the sixth stage 2620. In some embodiments, themedia-editing application displays the original version of the shapemask control 2234 when the media-editing application receives a commandindicating that the scaling operation is completed (e.g., by releasing amouse button, lifting a finger off a touchpad, or lifting a finger off atouchscreen).

While FIG. 26 illustrates a shape masking tool that provides a shapemask that allows the user to scale the size of the shape mask 2244 usingthe user-selectable shape mask control 2234, some embodiments of theshape masking tool allow the user to scale the size of the shape mask2244 by using any of the user-selectable shape mask controls 2234-2240in a similar fashion as that described in FIG. 26.

v. Rotating the Shape Mask

Although the above examples illustrate a number of ways for a user toadjust the shape and size of a shape mask provided by some embodimentsof the shape masking tool, the user may also want to rotate the shapemask to better fit around a particular object of interest in an image.In some embodiments, the shape masking tool provides a user-rotatableshape mask. FIG. 27 illustrates example operations of rotating the shapemask 2244 through the image display area 2218 of the GUI 2200 at fivedifferent stages 2712, 2714, 2716, 2718, and 2720.

The first stage 2712 continues from the last stage 2620 of FIG. 26. Asshown, the first stage 2712 is similar to the fifth stage 2620 of FIG.26, except the first stage 2712 illustrates that the user has initiateda rotation of the shape mask 2244 by selecting the shape mask control2232 using a cursor (e.g., by holding down a mouse button, tapping atouchpad, or touching a touchscreen). As shown, the selection of theshape mask control 2232 is indicated by displaying an enlarged versionof the shape mask control 2232. Some embodiments of the media-editingapplication display the enlarged version of the shape mask control 2232when the media-editing application receives the selection of the shapemask control 2232.

In the second stage 2714, the user has started to rotate the shape mask2244 by moving the cursor in a counter-clockwise direction with respectto the center of the shape mask 2244, as indicated by the arrow 2722. Asindicated by the arrow 2726, the movement of the cursor has caused theshape mask 2244 to in turn rotate in a counter-clockwise direction. Insome embodiments, the media-editing application rotates the shape mask2244 in a counter-clockwise direction when the media-editing applicationreceives the movement of the cursor in a counter-clockwise directionwith respect to the center of the shape mask 2244.

The third stage 2716 illustrates the GUI 2200 after the user hascompleted rotating the shape mask 2244 in a counter-clockwise direction.As shown, the original version of the shape mask control 2232 (which isillustrated at the fifth stage 2620 of FIG. 26) is displayed in the GUI2200. Some embodiments of the media-editing application display theoriginal version of the shape mask control 2232 when the media-editingapplication receives a command indicating that the rotation operation iscompleted (e.g., by releasing a mouse button, lifting a finger off atouchpad, or lifting a finger off a touchscreen).

In the fourth stage 2718, the user has initiated another rotation of theshape mask 2244 by selecting the user-selectable shape mask control 2232using the cursor (e.g., by holding down a mouse button, tapping atouchpad, or touching a touchscreen). The selection of theuser-selectable shape mask control 2232 is indicated by displaying anenlarged version of the shape mask control 2232. In some embodiments,the media-editing application displays the enlarged version of the shapemask control 2232 when the media-editing application receives theselection of the shape mask control 2232.

The fifth stage 2720 shows the GUI 2200 after the user has completedrotating the shape mask 2244 in a clockwise direction. As illustrated,the original version of the shape mask control 2232 (which isillustrated at the fifth stage 2620 of FIG. 26) is displayed in the GUI2200. In some embodiments, the media-editing application displays theoriginal version of the shape mask control 2232 when the media-editingapplication receives a command indicating that the rotation operation iscompleted (e.g., by releasing a mouse button, lifting a finger off atouchpad, or lifting a finger off a touchscreen).

vi. Adjusting the Curvature of the Shape Mask

After a user has adjusted the shape and size of a shape mask and hasrotated the shape mask to fit around an object of interest in an image,the user may wish to adjust the curvature of the shape mask to betterfit around the object of interest. Accordingly, some embodiments of theshape masking tool provide a shape mask that allows a user to adjust thecurvature of a shape mask.

FIG. 28 illustrates example operations of adjusting the curvature of theshape mask 2244 through the image display area 2218 of the GUI 2200 interms of five different stages 2812, 2814, 2816, 2818, and 2820. Thefirst three stages 2812, 2814, and 2816 illustrate the operation ofdecreasing the curvature of the shape mask 2244 (e.g., adjusting thecurvature of the shape mask 2244 to be more rectangular) while the lasttwo stages 2818 and 2820 illustrate the operation of increasing thecurvature of the shape mask 2244 (e.g., adjusting the curvature of theshape mask 2244 to be more rounded).

The first stage 2812 continues from the last stage 2720 of FIG. 27. Asshown, the first stage 2812 is similar to the fifth stage 2720 of FIG.27, except the first stage 2812 illustrates that the user has initiatedan adjustment of the curvature of the shape mask 2244 by selecting theshape mask control 2242 using a cursor (e.g., by holding down a mousebutton, tapping a touchpad, or touching a touchscreen). As shown, theselection of the shape mask control 2242 is indicated by displaying anenlarged version of the shape mask control 2242. The media-editingapplication of some embodiments displays the enlarged version of theshape mask control 2242 when the media-editing application receives theselection of the shape mask control 2242.

In the second stage 2814, the user has started to adjust the curvatureof the shape mask 2244 by moving the cursor along the inner shape 2226in a counter-clockwise direction with respect to the center of the shapemask 2244, as indicated by the arrow 2822. As shown in the second stage2814, the movement of the cursor has caused the curvature of the shapemask 2244 to decrease (i.e., to be more rectangular). In someembodiments, the media-editing application decreases the curvature ofthe shape mask 2244 when the media-editing application receives themovement of the cursor in a counter-clockwise direction with respect tothe center of the shape mask 2244.

The third stage 2816 illustrates the GUI 2200 after the user hascompleted adjusting the curvature of the shape mask 2244. Asillustrated, the curvature of the shape mask 2244 has been decreased asindicated by the more rectangular appearance of the shape mask 2244. Thethird stage 2816 additionally illustrates the original version of theshape mask control 2242 (which is illustrated at the fifth stage 2720 ofFIG. 27) displayed in the GUI 2200. In some embodiments, themedia-editing application displays the original version of the shapemask control 2242 when the media-editing application receives a commandindicating that the curvature adjustment operation is completed (e.g.,by releasing a mouse button, lifting a finger off a touchpad, or liftinga finger off a touchscreen).

In the fourth stage 2818, the user has initiated another adjustment ofthe curvature of the shape mask 2244 by selecting the user-selectableshape mask control 2242 using the cursor (e.g., by holding down a mousebutton, tapping a touchpad, or touching a touchscreen). As shown, anenlarged version of the shape mask control 2242 is displayed to indicatethe selection of the user-selectable shape mask control 2242. Someembodiments of the media-editing application display the enlargedversion of the shape mask control 2242 when the media-editingapplication receives the selection of the shape mask control 2242.

The fifth stage 2820 shows the GUI 2200 after the user has adjusted thecurvature of the shape mask 2244. The fifth stage 2820 also shows thatthe curvature of the shape mask 2244 has been increased as theappearance of the shape mask 2244 is more rounded than the shape of theshape mask 2244 in the third stage 2816. In addition, the fifth stage2820 shows the original version of the shape mask control 2242 (which isillustrated at the fifth stage 2720 of FIG. 27) displayed in the GUI2200. Some embodiments of the media-editing application display theoriginal version of the shape mask control 2242 when the media-editingapplication receives a command indicating that the curvature adjustmentoperation is completed (e.g., by releasing a mouse button, lifting afinger off a touchpad, or lifting a finger off a touchscreen).

vii. Adjusting the Transition Region of the Shape Mask

As mentioned above, when a color correction operation is applied to animage, a transition region (e.g., partially selected pixels in theimage) provides a smooth transition between pixels in the image to whichthe color correction operation is applied and pixels in the image towhich the color correction operation is not applied. In some instances,a user might want to adjust the transition region of a shape mask toprovide a smaller or larger transition region for the shape mask.

FIG. 29 illustrates example operations of adjusting the transitionregion of the shape mask 2244 through the image display area 2218 of theGUI 2200 at five different stages 2912, 2914, 2916, 2918, and 2920. Thefirst three stages 2912, 2914, and 2916 illustrate the operation ofuniformly enlarging the transition region of the shape mask 2244 whilethe last two stages 2918 and 2920 illustrate the operation of uniformlyshrinking the transition region of the shape mask 2244. As noted above,the transition region of the shape mask 2244, in this example, is aregion between the outer shape 2228 and the inner shape 2226.

The first stage 2912 continues from the fifth stage 2820 of FIG. 28. Asshown, the first stage 2912 is similar to the fifth stage 2820 of FIG.28, except the first stage 2912 illustrates that the user has initiatedan adjustment of the transition region of the shape mask 2244 byselecting the outer shape 2228 using a cursor (e.g., by holding down amouse button, tapping a touchpad, or touching a touchscreen). As shown,the selection of the outer shape 2228 is indicated by displaying athicker version of the outer shape 2228. In some embodiments, themedia-editing application displays the thicker version of the outershape 2228 when the media-editing application receives the selection ofthe outer shape 2228.

In the second stage 2914, the user has started to adjust the transitionregion of the shape mask 2244 by moving the cursor away from the centerof the shape mask 2244, as indicated by the arrow 2922. As indicated bythe arrows 2924-2930, the movement of the cursor has caused thetransition region of the shape mask 2244 to uniformly enlarged. In someembodiments, the media-editing application enlarges the transitionregion of the shape mask 2244 when the media-editing applicationreceives the movement of the cursor away from the center of the shapemask 2244.

The third stage 2916 shows the GUI 2200 after the user has completedadjusting the transition region of the shape mask 2244. As shown in thethird stage 2916, the transition region of the shape mask 2244 has beenuniformly enlarged. The third stage 2916 also illustrates the originalversion of the outer shape 2228 (which is illustrated at the fifth stage2820 of FIG. 28) displayed in the GUI 2200. In some embodiments, themedia-editing application displays the original version of the outershape 2228 when the media-editing application receives a commandindicating that the transition region adjustment operation is completed(e.g., by releasing a mouse button, lifting a finger off a touchpad, orlifting a finger off a touchscreen).

In the fourth stage 2918, the user has initiated another adjustment ofthe transition region of the shape mask 2244 by selecting the outershape 2228 (e.g., by holding down a mouse button, tapping a touchpad, ortouching a touchscreen). As illustrated, a thicker version of the outershape 2228 is displayed to indicate the selection of the outer shape2228. The media-editing application of some embodiments displays thethicker version of the outer shape 2228 when the media-editingapplication receives the selection of the outer shape 2228.

The fifth stage 2920 illustrates the GUI 2200 after the user hascompleted adjusting the transition region of the shape mask 2244. Asshown in the fifth stage 2922, the transition region of the shape mask2244 has been uniformly shrunk compared to the transition region of theshape mask 2244 shown in the third stage 2916. The fifth stage 2920 alsoshows the original version of the outer shape 2228 (which is illustratedat the fifth stage 2820 of FIG. 28) displayed in the GUI 2200. Themedia-editing application of some embodiments displays the originalversion of the outer shape 2228 when the media-editing applicationreceives a command indicating that the transition region adjustmentoperation is completed (e.g., by releasing a mouse button, lifting afinger off a touchpad, or lifting a finger off a touchscreen).

Although FIG. 29 illustrates several adjustments to a transition regionof a shape mask that has a particular amount of curvature, similaradjustments may be performed to a transition region of a shape mask thathas a different amount of curvature. For example, FIG. 30 illustratesexample adjustments, which are performed in a similar manner as thosedescribed above by reference to FIG. 29, to a transition region of ashape mask that has more curvature (e.g., more rounded) than the shapemask illustrated in FIG. 29. As another example, FIG. 31 illustratesexample adjustments, which are also performed in a similar manner asthose described above by reference to FIG. 29, to a transition region ofa shape mask that has less curvature (e.g., more rectangular) than theshape mask illustrated in FIG. 29.

viii. Different Shapes of a Shape Mask

In some embodiments, the shape masking tool provides a shape mask that auser may manipulate into different superellipse-based shapes byperforming one or more of the operations that have been illustratedabove by reference to FIGS. 22-31. Generally, a superellipse is atwo-dimensional geometric figure defined in the Cartesian coordinatesystem as the set of all points (x, y) by the following equation:

$\begin{matrix}{{{\frac{x}{a}}^{n} + {\frac{y}{b}}^{n}} = 1} & (4)\end{matrix}$where a, b, and n are positive numbers. Furthermore, equation (4)defines a closed curve that is contained in a rectangle where:−a≦x≦+a and −b≦y≦bIn some embodiments, a and b are referred to as semi-diameters of theclosed curve. The semi-diameters of a closed curve, in some embodiments,are the halves of the closed curve's length along the two axes ofsymmetry of the closed curve. In some embodiments, a superellipsedefined by equation (4) may be referred to as a rectangle with cornersthat are truncated and rounded. A rectangle includes other types ofquadrilaterals, such as a square.

Accordingly, the shape of the shape masks of some embodiments is definedbased on the above equation (4). As explained above, the shape maskingtool of some embodiments provides a shape mask that a user canmanipulate a variety of different ways. For example, some embodimentsallow the user to adjust the curvature of a shape mask provided by someembodiments of the shape masking tool. In some of these embodiments,adjusting the curvature of the shape mask (e.g., as described above byreference to FIG. 28) corresponds to adjusting the n variable inequation (4). For example, increasing the curvature (e.g., adjusting theshape of the shape mask to appear more rounded) of the shape maskcorresponds to decreasing the n variable and decreasing the curvature(e.g., adjusting the shape of the shape mask to appear more rectangular)of the shape mask corresponds to increasing the n variable. In someembodiments, the value of n used to define the different superellipseshapes of the shape mask of some embodiments ranges from 2 to 10.However, other ranges and/or values of n are possible in otherembodiments.

In addition, some embodiments allow the user to adjust the dimensions ofa shape mask. For instance, some of these embodiments allow the user toadjust a shape mask along two orthogonal dimensions (e.g., as describedabove by reference to FIGS. 24 and 25) of the shape mask. In some suchembodiments, adjusting one of the orthogonal dimensions of the shapemask (e.g., a semi-diameter of the shape mask) corresponds to adjustingone of the variables a and b in equation (4) (e.g., adjusting thedimension of the shape mask using user-selectable shape mask control2234, as illustrated in FIG. 24, adjusts variable a) and adjusting theother orthogonal dimension of the shape mask (e.g., anothersemi-diameter of the shape mask) corresponds to adjusting the other ofthe variables a and b in equation (4) (e.g., adjusting the dimension ofthe shape mask using user-selectable shape mask 2236, as illustrated inFIG. 25, adjusts b).

As described above by reference to FIG. 27, some embodiments of theshape masking tool allow the user to rotate the shape mask. In someembodiments, a rotation transform is applied to the shape mask toimplement the rotation of the shape mask. In this manner, adjustments tothe dimensions of the shape mask (e.g., by using user-selectable shapemask controls 2234 or 2236) still adjust the corresponding variables aand b of equation (4), even when the shape mask has been rotated. Forexample, a shape mask may be rotated 45 degrees with respect to theimage and the shape mask may be defined along x and y axes that are alsorotated 45 degrees with respect to the image. In this example, auser-selectable shape mask control for adjusting the dimension of theshape mask along the x axis, which has been rotated 45 degrees, adjuststhe variable a of equation (4) that is used to define the shape mask. Inaddition, a user-selectable shape mask control for adjusting thedimension of the shape mask along the y axis, which has been rotated 45degrees, adjusts the variable b of equation (4) that is used to definethe shape mask.

In some embodiments, the user may select and drag a user-selectableshape mask control for adjusting a dimension of the shape mask in anon-collinear direction with respect to the dimension of the shape mask.In such cases, the shape mask is adjusted to the extent of theadjustment along the dimension component of the adjustment. Forinstance, continuing with the example above, using the user-selectableshape mask control for adjusting the dimension of the shape mask alongthe x axis and adjusting the shape mask along a direction that isnon-collinear with respect to the 45 degree rotated x axis, adjusts thevariable a of the shape mask to the extent of the adjustment along the xaxis. On the other hand, some embodiments of the shape masking tooladjust the shape mask along multiple dimensions of the shape mask whenthe user selects and drags a user-selectable shape mask control foradjusting a dimension of the shape mask in a non-collinear directionwith respect to the dimension of the shape mask. For instance,continuing with the example, using the user-selectable shape maskcontrol for adjusting the dimension of the shape mask along the x axisand adjusting the shape mask along a direction that is non-collinearwith respect to the 45 degree rotated x axis, adjusts the variable a ofthe shape mask to the extent of the adjustment along the x axis andadjusts the variable b of the shape mask to the extent of the adjustmentalong the y axis.

The following FIG. 32 illustrates an example sequence of operations thatmanipulate a shape mask of some embodiments into a number of differentshapes and sizes to demonstrate the versatility and flexibility of theshape mask. In particular, FIG. 32 conceptually illustrates six examplesuperellipse shapes 3212-3222 of the shape mask 2244 that can be formedusing one or more of the operations described above by reference toFIGS. 22-31.

As shown, the superellipse shape 3212 of FIG. 32 illustrates the shapemask 2244 as a circle. As described above, the shape masking tool ofsome embodiments provides a shape mask in the form of the superellipseshape 3212 as a default shape mask when the shape masking tool isinvoked.

The superellipse shape 3214 of the shape mask 2244 illustrated in FIG.32 shows the shape mask 2244 after the superellipse shape 3212 of theshape mask 2244 has been vertically elongated to appear as an elongatedellipse. Some embodiments adjust the superellipse shape 3212 of theshape mask 2244 to appear like the superellipse shape 3214 by performingoperations similar to those illustrated in FIG. 24 and correspondinglydescribed by reference to FIG. 24.

As illustrated in FIG. 32, the superellipse shape 3216 illustrates theshape of the shape mask 2244 after the superellipse shape 3214 of theshape mask 2244 has been rotated. In some embodiments, the superellipseshape 3214 of the shape mask 2244 is rotated in a similar manner asillustrated in FIG. 27 and correspondingly described by reference toFIG. 27.

Next, FIG. 32 shows superellipse shape 3218 as the shape of the shapemask 2244 after the superellipse shape 3216 of the shape mask 2244 hasbeen rotated. Like the superellipse shape 3214 of the shape mask 2244,some embodiments rotate the superellipse shape 3216 of the shape mask2244 in a similar manner as illustrated in FIG. 27 and correspondinglydescribed by reference to FIG. 27.

The superellipse shape 3220 illustrates the shape mask 2244 after thecurvature of the superellipse shape 3218 of the shape mask 2244 has beenadjusted. In particular, the curvature of the superellipse shape 3218has been decreased. As such, the superellipse shape 3220 of the shapemask 2244 appears more rectangular. In some embodiments, the curvatureof the superellipse shape 3218 of the shape mask 2244 is adjusted in asimilar fashion as illustrated in FIG. 28 and correspondingly describedby reference to FIG. 28.

Finally, FIG. 32 also shows the superellipse shape 3222 of the shapemask 2244 after the curvature of the superellipse shape 3220 has beenadjusted. As shown, the curvature of the superellipse shape 3220 of theshape mask 2244 has been further decreased. Thus, the superellipse shape3222 of the shape mask 2244 appears more rectangular than thesuperellipse shape 3220 of the shape mask 2244. Some embodiments adjustthe curvature of the superellipse shape 3220 of the shape mask 2244 in asimilar manner as illustrated in FIG. 28 and correspondingly describedby reference to FIG. 28.

Although FIG. 32 illustrates a shape mask that can be manipulatedbetween different superellipse shapes with different curvatures thatrange from a rectangular like superellipse shape to an ellipse,different embodiments of the shape masking tool provide different shapemasks that can be manipulated between different shapes. For instance,some embodiments of the shape masking tool provide a shape mask that canbe manipulated between a quadrilateral (e.g., a rectangle) and anellipse (e.g., a circle), and different shapes in between with differentamounts of curvature.

Some embodiments may provide a shape mask that can be manipulatedbetween different quadrilaterals (e.g., a rectangle) that have roundedcorners with different corner radii (e.g., arc lengths). For example,the shape masking tool of some of these embodiments may provide a shapemask that can be manipulated into a rectangle with a very small cornerradius such that, to the perception of the human eye, the rectangle hassharp corners. In other words, the rectangle is 99.99% similar to arectangle that has sharp ninety degree corners. Mathematically, however,the rectangle has rounded corners. However, some embodiments allow therectangle to be defined with a corner radius of zero. Also, the shapemask may be manipulated into a rectangle with rounded corners that havea very large corner radius.

The rounded corner of the rectangle may be defined based on the arclength of a circle, in some embodiments. In some such embodiments, thewidth and height of each of the rounded corners are equal. In someembodiments, a rectangle with such rounded corners may be referred to asa roundrect. Alternatively, some embodiments may allow each of therounded corners of the rectangle to be defined with unequal width andheight. For instance, width and height of the rounded corners may bedefined as proportional to the width and height of the rectangle. Inthis manner, the shape mask with such a rectangle may be manipulatedbetween a rectangle with a very minimal amount of roundness so as toappear as a rectangle with ninety degree corners and a rectangle withrounded corners proportional to the width and height of the rectangle soas to appear as an ellipse.

A rectangle with rounded corners provides a smoother transition regiondue to the lack of sharp corners. As such, this type of shape providesbetter softening of color correction operations in the regions of theimage to which the shape is placed.

While many of the examples described above illustrate user-selectableshape mask controls that are displayed over a shape mask (also referredto as on screen controls (OSCs)), some embodiments may provide,alternatively, or in conjunction with the OSCs illustrated above, othertypes of user-selectable shape mask controls. For instance, someembodiments of the shape masking tool provide slider controls that areincluded in the adjustments panel 2220 and that are for manipulating ashape mask provided by the shape masking tool.

B. Image Processing

As mentioned above, the shape mask of some embodiments is foridentifying a region in an image (i.e., pixels) to which colorcorrection operations (e.g., hue adjustments, saturation adjustments,brightness adjustments, etc.) are applied. In some embodiments, colorcorrection operations are applied to the image based on values assignedto pixels in the image.

For example, some of these embodiments assign a value within apredetermined range (called an alpha value in some embodiments) to eachpixel in the image based on the region in which the pixel is located.Pixels that are located in a region identified to be fully selected havea maximum alpha value within the range and pixels that are located in aregion identified to be not selected at all have a minimum alpha valuewithin the range. Pixels that are located in a region that is neither“fully selected” nor “not selected”, also known as the transitionregion, have alpha values between the minimum alpha value and themaximum alpha value (also referred to pixels that are partiallyselected). The alpha value of each of the pixels within the transitionregion is dependent on where in the transition region the pixel islocated. In some embodiments, the closer the pixel is to the region ofthe fully selected pixels, the higher the alpha value.

Some embodiments define an alpha value range of 0-1. In thoseembodiments, pixels that are fully selected have an alpha value of 1 andpixels that are not selected at all have an alpha value of 0. Pixelsthat are located within the transition region have an alpha valuebetween 0 and 1, depending on where in the transition region the pixelis located. For instance, pixels located closer to “not selected” pixelsare assigned lower alpha values than pixels located close to “fullyselected” pixels. In this fashion, the alpha values of pixels in thetransition region gradually decrease between regions that include “fullyselected” pixels and regions that include “not selected” pixels.

In some embodiments, the alpha value of a particular pixel indicates theextent to which color correction operations are applied to theparticular pixel. Thus, a pixel with an alpha value of 0.75 would beaffected three-fourths as much by a color correction operation as apixel with an alpha value of 1. In some embodiments, a color correctionoperation affects the pixel values (e.g., the RGB values, YCbCr values,etc.) of a pixel, so this color correction operation is damped for apixel with an alpha value less than 1. If, for example, the colorcorrection multiplies the luma (Y) value of a selected pixel by 4, thenthe pixel with an alpha value of 0.75 would have its luma valuemultiplied only by 3.

In some embodiments, the shape masking tool allows a user to use a shapemask to identify pixels in an image as either fully selected, notselected, or partially selected (e.g., as part of the transition region)so that different alpha values can be assigned to those pixels. FIGS. 33and 34 illustrate examples of assigning different alpha values to pixelsin an image based on a shape mask according to some embodiments of theinvention.

As shown in FIG. 33, the GUI 2200 includes the image display area 2218for displaying an image 3316, a user-selectable UI item 3320 foridentifying pixels located within the inner shape 2226 of the shape mask2244 as fully selected, and a user-selectable UI item 3322 foridentifying pixels located outside of the outer shape 2228 of the shapemask 2244 as fully selected. As shown in the GUI 2200 of FIG. 33, theshape mask 2244 has been manipulated to cover a rectangular object belowthe statue in the image 3316. In this example, the user has selected theUI item 3320 (e.g., through a cursor operation such as clicking a mousebutton, tapping a touchpad, or touching a touchscreen). When the userselects the UI item 3320, the media-editing application identifiespixels located inside of the inner shape 2226 of the shape mask 2244 asfully selected (also referred to as an inner mask), pixels locatedoutside of the outer shape 2228 of the shape mask 2244 as not selected,and pixels located between the inner shape 2226 and the outer shape 2228of the shape mask 2244 as partially selected.

3314 illustrates a graphical representation of alpha values beingassigned to different pixels in the image 3316 based on the shape mask2244. In 3314, the region 3330 that is inside the inner shape 2226 ofthe shape mask 2244 is shown in white, indicating that each of thepixels located in the region 3330 is assigned a maximum alpha value(i.e., fully selected). The region 3332 that is outside of the outershape 2228 of the shape mask 2244 is shown in black, indicating thateach of the pixels located in the region 3332 is assigned a minimumalpha value (i.e., not selected). The region 3334 that is between theinner shape 2226 and the outer shape 2228, also known as the transitionregion, is shown in grey, indicating that each of the pixels in theregion 3334 is assigned an alpha value between the minimum alpha valueand the maximum alpha value (i.e., partially selected). In this example,when a color correction operation is applied to the image 3316, the fullextent of the color correction operation is applied to the pixels withinthe region 3330. The extent of the color correction operation that isapplied to the pixels within the transition region 3334 is based on theposition of the pixel with respect to the region 3330 and the region3332. The closer the pixel is to the region 3330, the greater the extentof the color correction that is applied to the pixel. In addition, thecolor correction operation is not applied to the pixels within theregion 3332 as those pixels are not selected.

3412 of FIG. 34 is similar to 3312 of FIG. 33, except, for the exampleillustrated in FIG. 34, the user has selected the UI item 3322 (e.g.,through a cursor operation such as clicking a mouse button, tapping atouchpad, or touching a touchscreen). When the user selects the UI item3322, the media-editing application identifies pixels located outside ofthe outer shape 2228 of the shape mask 2244 as fully selected (alsoreferred to as an outer mask), pixels located inside of the inner shape2226 of the shape mask 2244 as not selected, and pixels located betweenthe inner shape 2226 and the outer shape 2228 of the shape mask 2244 aspartially selected.

3414 illustrates a graphical representation of alpha values beingassigned to different pixels in the image 3316 based on the shape mask2244. In 3414, the region 3332 that is outside of the outer shape 2228of the shape mask 2244 is shown in white, indicating that each of thepixels located in the region 3332 is assigned a maximum alpha value(i.e., fully selected). The region 3330 that is inside the inner shape2226 of the shape mask 2244 is shown in black, indicating that each ofthe pixels located in the region 3330 is assigned a minimum alpha value(i.e., not selected). The region 3334 that is between the inner shape2226 and the outer shape 2228, also known as the transition region, isshown in grey, indicating that each of the pixels in the region 3334 isassigned an alpha value between the minimum alpha value and the maximumalpha value (i.e., partially selected). In this example, when a colorcorrection operation is applied to the image 3316, the full extent ofthe color correction operation is applied to the pixels within theregion 3332. The extent of the color correction operation that isapplied to the pixels within the transition region 3334 is based on theposition of the pixel with respect to the region 3330 and the region3332. The closer the pixel is to the region 3332, the greater the extentof the color correction that is applied to the pixel. Additionally, thecolor correction operation is not applied to the pixels within theregion 3330 since those pixels are not selected.

C. Applying the Different Shapes of the Shape Mask

As mentioned some embodiments of the shape masking tool provides a shapemask that allows a user to identify a portion of an image (an area ofinterest) and apply a color correction operation to pixels in theportion of the image. Often times, the area of interest is not in aregular shape (i.e., a circle or a rectangle). Thus, the ability tomanipulate a shape mask in various different shapes (e.g., an ellipse,an oval, a square with rounded edges, a rectangle with rounded edges,etc.) allows the user to customize the shape mask to fit different areasof interest.

FIGS. 35A-37B illustrate the operations of manipulating a shape mask tocover areas of interest of different sizes and shapes. It will be shownthrough these figures that a particular shape of the shape mask (i.e.,an ellipse, a rectangle with rounded edges, or an oval) will be a goodfit for each of the three areas of interest.

FIGS. 35A and 35B illustrates the operation of manipulating the shapemask 2244 at six different stages 3512, 3514, 3516, 3518, 3520, and 3522of the GUI 2200. As shown in the first stage 3512, the image displayarea 2218 displays an image 3526 that includes a statue in theforeground and a building in the background. In this example, the statuein the foreground in the image 3526 is the area of interest of the user.The first stage 3512 shows that the shape mask 2244 has been invoked andis displayed near the middle of the image display area 2218.

The second stage 3514 through the fifth stage 3520 illustrate the shapemask 2244 being manipulated through a series of operations (similar tothe operations described above by reference to FIGS. 22-31) so that theshape mask 2244 fits the size and shape of the statue.

Specifically, the second stage 3514 illustrates that the shape mask 2244has been moved from the middle of the image display area 2218 to themiddle of the statue. In the third stage 3516, the shape of the shapemask 2244 has been horizontally shortened so that the width of the shapemask 2244 is better aligned with the width of the statue. The fourthstage 3518 illustrates that the shape mask 2244 has been rotated in acounter-clockwise direction so that the shape mask 2244 is betteraligned with the statue. In the fifth stage 3520, the shape of the shapemask 2244 has been vertically adjusted so that the shape mask 2244covers the entire height of the statue.

As shown in this example, the shape mask 2244 has been manipulated intoan elliptical shape in order to provide a good fit for the area ofinterest in the image 3526. In the sixth stage 3522, the user hasselected the UI item 3532 (e.g., through a cursor operation such asclicking a mouse button, tapping a touchpad, or touching a touchscreen)in order to apply to the image 3526 a color correction operationassociated with the UI item 3532. When the user selects the UI item3532, the media-editing application of some embodiments applies to theimage 3526 the color correction operation associated with the UI item3532. As shown in this example, the color correction operation has beenapplied to an inner mask option of the shape mask 2244 as indicated byan increased brightness of pixels within the shape mask 2244.

FIGS. 36A and 36B illustrates the operation of manipulating the shapemask 2244 at six different stages 3612, 3614, 3616, 3618, 3620, and 3622of the GUI 2200. The first stage 3612 illustrates the image display area2218 displaying an image 3626 that includes a statue and a rectangularobject below the statue in the foreground, and a building in thebackground. In this example, the rectangular object below the statue inthe foreground in the image 3626 is the area of interest of the user.The first stage 3612 illustrates that the shape mask 2244 has beeninvoked and is displayed near the middle of the image display area 2218.

The second stage 3614 through the fifth stage 3620 illustrate the shapemask 2244 being manipulated through a series of operations (similar tothe operations described above by reference to FIGS. 22-31) so that theshape mask 2244 fits the size and shape of the rectangular object.

In particular, the second stage 3614 illustrates that the shape mask2244 has been moved from the middle of the image display area 2218 tothe middle of the rectangular object. In the third stage 3616, the shapeof the shape mask 2244 has been horizontally shortened so that the widthof the shape mask 2244 is better aligned with the width of therectangular object. The fourth stage 3618 illustrates that the shape ofthe shape mask 2244 has been vertically shortened so that the shape mask2244 is better aligned with the height of the rectangular object. In thefifth stage 3620, the curvature of the shape mask 2244 has beendecreased in order to manipulate the shape mask 2244 into a morerectangular shape to better fit the rectangular object.

As shown in this example, the shape mask 2244 has been manipulated intoa rectangular shape with rounded corners in order to provide a good fitfor the area of interest in the image 3626. In the sixth stage 3622, theuser has selected the UI item 3632 (e.g., through a cursor operationsuch as clicking a mouse button, tapping a touchpad, or touching atouchscreen) in order to apply to the image 3626 a color correctionoperation associated with the UI item 3632. When the user selects the UIitem 3632, the media-editing application of some embodiments applies tothe image 3626 the color correction operation associated with the UIitem 3632. As shown in this example, the color correction operation hasbeen applied to an inner mask option of the shape mask 2244 as indicatedby an increased brightness of pixels within the shape mask 2244.

FIGS. 37A and 37B illustrates the operation of manipulating the shapemask 2244 at six different stages 3712, 3714, 3716, 3718, 3720, and 3722of the GUI 2200. As shown in the first stage 3712, the image displayarea 2218 displays an image 3726 that includes two children in theforeground and a plaza in the background. In this example, the twochildren in the foreground of the image 3726 is the area of interest ofthe user. The first stage 3712 shows that the shape mask 2244 has beeninvoked and is displayed near the middle of the image display area 2218.

The second stage 3714 through the fifth stage 3720 illustrate the shapemask 2244 being manipulated through a series of operations (similar tothe operations described above by reference to FIGS. 22-31) so that theshape mask 2244 fits the size and shape of the two children.

Specifically, the second stage 3714 illustrates that the shape mask 2244has been moved from the middle of the image display area 2218 to themiddle of the two children. In the third stage 3716, the shape of theshape mask 2244 has been horizontally shortened so that the width of theshape mask 2244 is better aligned with the width of the two children.The fourth stage 3718 illustrates that the shape of the shape mask 2244has been vertically elongated so that the shape mask 2244 is betteraligned with the height of the two children. In the fifth stage 3720,the curvature of the shape mask 2244 has been increased in order tomanipulate the shape mask 2244 into a more oval shape to better fit thetwo children.

As shown in this example, the shape mask 2244 has been manipulated intoan oval shape in order to provide a good fit for the area of interest inthe image 3726. In the sixth stage 3722, the user has selected the UIitem 3632 (e.g., through a cursor operation such as clicking a mousebutton, tapping a touchpad, or touching a touchscreen) in order to applyto the image 3726 a color correction operation associated with the UIitem 3632. When the user selects the UI item 3632, the media-editingapplication of some embodiments applies to the image 3726 the colorcorrection operation associated with the UI item 3632. As shown in thisexample, the color correction operation has been applied to an innermask option of the shape mask 2244 as indicated by an increasedbrightness of pixels within the shape mask 2244.

D. Two Alphas

The above FIGS. 33 and 34 illustrate applying a color correctionoperation based on an inner mask option of a shape mask and applying acolor correction operation based on an outer mask option of the sameshape mask. In some embodiments, the shape masking tool allows the userto simultaneously apply one color correction operation based on an innermask option of a shape mask and another color correction operation basedon an outer mask option of the shape mask.

FIG. 38 illustrates such an operation at four different stages 3812,3814, 3816, and 3818 of the GUI 2200. As shown in FIG. 38, the GUI 2200includes the image display area 2218 for displaying an image 3822 thatincludes a statue and a rectangular object below the statue in theforeground, and a building in the background.

In the first stage 3812, the user has invoked a shape masking tool andhas manipulated the shape mask 2244 to cover the rectangular object inthe image 3822. In addition, the user has selected the UI item 3320, asindicated by a highlighting of the UI item 3320. When the user selectsthe UI item 3320, some embodiments of the media-editing applicationidentify pixels located inside of the outer shape 2228 of the shape mask2244 as fully selected, pixels located outside of the outer shape 2228of the shape mask 2244 as not selected, and pixels located between theinner shape 2226 and the outer shape 2228 of the shape mask 2244 aspartially selected.

The second stage 3814 illustrates that the user has applied a firstcolor correction operation to the image 3822. As shown, a full extent ofthe first color correction operation has been applied to the pixelslocated inside the inner shape 2226 of the shape mask 2244, as indicatedby a darkening of the region of the image 3822 inside the inner shape2226. A lesser extent of the first color correction operation has beenapplied to the pixels located in the transition region (i.e., the regionbetween the inner shape 2226 and the outer shape 2228). In addition, noeffect has been applied to the pixels located outside of the outer shape2228 of the shape mask 2244.

In the third stage 3816, the user has selected the UI item 3322, asindicated by a highlighting of the UI item 3322. When the user selectsthe UI item 3322, some embodiments of the media-editing applicationidentify pixels located outside of the outer shape 2228 of the shapemask 2244 as fully selected, pixels located inside of the inner shape2226 of the shape mask 2244 as not selected, and pixels located betweenthe inner shape 2226 and the outer shape 2228 of the shape mask 2244 aspartially selected.

The fourth stage 3818 illustrates that the user has applied a secondcolor correction operation to the image 3822. As shown, a full extent ofthe second color correction operation has been applied to the pixelslocated outside of the outer shape 2228 of the shape mask 2244, asindicated by a brightening of the region of the image outside of theouter shape 3830. A lesser extent of the second color correctionoperation has been applied to the pixels located in the transitionregion (i.e., the region between the inner shape 2226 and the outershape 2228). Lastly, no effect has been applied to the pixels locatedinside the inner shape 2226 of the shape mask 2244.

The examples illustrated above describe creating and adjusting a shapemask for a still image. As mentioned above, the shape masking tool canprovide a shape mask for identifying a region in a frame (or field) of avideo clip in some embodiments. In some of these embodiments, the shapemask identifies a region of a particular frame of a video clip andassociates the identified region with the rest of the frames in thevideo clip. For instance, a user may create a shape mask, adjust theshape mask to identify a region of a frame of a video clip, and invoke acolor correction operation on the frame of the video clip. When the userinvokes the color correction operation on the frame, the shape maskingtool of some embodiments applies the color correction to the identifiedregion of the frame and automatically applies the color correction tothe corresponding region of each of the other frames in the video clip.This way, the user only has to create a shape mask for one frame of avideo clip (instead of creating a shape mask for each frame of the videoclip) in order to apply a color correction operation to a region of eachframe of the entire video clip.

III. Color Mask and Shape Mask Example

As described above in Section I, a masking tool of some embodimentsallows a user to identify a portion of an image based on the colors inthe image. Section II described a masking tool of some embodiments thatallows a user to identify a portion of an image based on a spatialregion in the image. However, some embodiments provide a masking toolthat includes both color-based and spatial-based masking tools toprovide a user with greater flexability and control in identifying aportion of an image. For example, a user may use the color-based maskingtool to identify a color of an object of interest in the image to applya color correction operation, but the image may include other objectswith the same or similar color to which the user does not wish to applythe color correction operation. The user may use the shape-based maskingtool to isolate the identification of the color to the object ofinterest in the image and, thereby, isolating the application of thecolor correction operation to the object of interest in the image.

FIG. 39 conceptually illustrates a masking tool of some embodiments thatincludes a color masking tool and a shape masking tool. Specifically,FIG. 39 conceptually illustrates the GUI 2200 at five different stages3905-3925 of a masking operation that utilizes a color mask and a shapemask to identify a portion of an image 3930.

The first stage 3905 illustrates the GUI 2200, which includes the imagedisplay area 2218 and the adjustments panel 2220. As shown, the imagedisplay area 2218 is displaying the image 3930 of a bird and a piece offruit next to the bird. In this example, the user wants to apply a colorcorrection operation to only the feathers of the bird's belly, which isthe same or similar color as the color of the fruit.

In the second stage 3910, the user has activated the masking tool'scolor masking tool by selecting the user-selectable UI item 2140 (e.g.,by performing a cursor operation such as clicking a mouse button,tapping a touchpad, or touching a touchscreen). In addition, the userhas selected a portion of the feathers of the bird's belly in order tocreate a color mask. Since the color of the fruit is the same or similarto the color of the feathers of the bird's belly, the color maskincludes the fruit as well as the feathers of the bird's belly.

The third stage 3915 of the GUI 2200 illustrates that the user hasinvoked the masking tool's shape masking tool by selecting the UI item2222 using a cursor (e.g., by performing a cursor operation such asclicking a mouse button, tapping a touchpad, or touching a touchscreen).Additionally, the third stage 3915 shows that the user has manipulatedthe shape mask 2244 through a series of operations (e.g., the operationsdescribed above by reference to FIGS. 22-31) to fit the shape maskaround the bird, thereby isolating the colors of the color mask to onlythe portion of the image encompassed by the shape mask.

The fourth stage 3920 illustrates that the user has activated the colorboard tool of some embodiments by selecting the user-selectable UI item2150 (e.g., by performing a cursor operation such as clicking a mousebutton, tapping a touchpad, or touching a touchscreen). As shown in thefourth stage 3920, the adjustments panel 2220 displays a color board3940. In some embodiments, when the media-editing application receivesthe selection of the UI item 2150, the media-editing applicationdisplays the color board 3940 in the adjustments panel 2220. In otherembodiments, when the media-editing application receives the selectionof the UI item 2150, the media-editing application displays the colorboard 2175 (not shown here) in the adjustments panel 2220. In some suchembodiments, the user might have to select user-selectable tab 3950 inorder to cause the media-editing application to transition fromdisplaying the color board 2175 to displaying the color board 3940.

The color board 3940 includes several slider controls that can bemovably positioned within the color board 3940 to adjust the exposure(e.g., luminance, luma, brightness) of pixels in the image 3930.Different locations on the color board 3940 correspond to differentlevels of exposure. In this example, the middle of the color board 3940represents no adjustment to the exposure of pixels in the image,positions above the middle of the color board 3940 represent increasesto the exposure of pixels in the image, and positions below the middleof the color board 3940 represent decreases to the exposure of pixels inthe image.

In the fifth stage 3925, the GUI 2200 shows that the user has moved theslider indicator of the slider control 3945 towards the upper portion ofthe slider control 3945 in order to increase the exposure of the pixelsin the image. In some embodiments, the media-editing applicationincreases the exposure of the pixels in the image when the media-editingapplication receives movement of the slider indicator of the slidercontrol 3945. As shown in the fifth stage 3925, the color correction(the exposure adjustment in this example) is only applied to the colorsincluded in the color mask that are inside the shape mask (the feathersof the bird's belly in this example), which is indicated by ahighlighting of the feathers of the bird's belly.

The example illustrated in FIG. 39 describes creating and adjusting acolor mask and a shape mask for a still image. As explained above, themasking tool can provide a shape mask for identifying a region in aframe (or field) of a video clip and define a color mask for the frameof the video clip, in some embodiments. In some of these embodiments,the masking tool defines a color mask for a particular frame of a videoclip and identifies a region of the particular frame of the video clip.The masking tool associates the color mask and the identified regionwith the rest of the frames in the video clip. For instance, a user maycreate a color mask for a frame of a video clip, create a shape mask andadjust the shape mask to identify a region of a frame of a video clip,and invoke a color correction operation on the frame of the video clip.When the user invokes the color correction operation on the frame, themasking tool of some embodiments applies the color correction to theidentified region of the frame using the color mask and automaticallyapplies the color correction to the corresponding region of each of theother frames in the video clip using the color mask. In this manner, theuser only has to create a color mask and a shape mask for one frame of avideo clip (instead of creating a color mask and a shape mask for eachframe of the video clip) in order to apply a color correction operationto a region of each frame of the entire video clip based on colors inthe frames.

IV. Example Graphical User Interface

The figures described above illustrate different GUIs and portions ofdifferent GUIs that provide a color correction tool(s) of someembodiments. The following figure illustrates an example GUI of amedia-editing application that may provide any number of the differentcolor correction tools described above.

As shown, FIG. 40 illustrates a graphical user interface (GUI) 4000 of amedia-editing application of some embodiments. One of ordinary skill inthe art will recognize that the graphical user interface 4000 is onlyone of many possible GUIs for such a media-editing application. In fact,the GUI 4000 includes several display areas which may be adjusted insize, opened or closed, replaced with other display areas, etc. The GUI4000 includes a clip library 4005, a clip browser 4010, a timeline 4015,a preview display area 4020, an inspector display area 4025, anadditional media display area 4030, and a toolbar 4035.

The clip library 4005 includes a set of folders through which a useraccesses media clips that have been imported into the media-editingapplication. Some embodiments organize the media clips according to thedevice (e.g., physical storage device such as an internal or externalhard drive, virtual storage device such as a hard drive partition, etc.)on which the media represented by the clips are stored. Some embodimentsalso enable the user to organize the media clips based on the date themedia represented by the clips was created (e.g., recorded by a camera).As shown, the clip library 4005 includes media clips from both years2009 and 2011.

Within a storage device and/or date, users may group the media clipsinto “events”, or organized folders of media clips. For instance, a usermight give the events descriptive names that indicate what media isstored in the event (e.g., the “New Event 2-8-09” event shown in cliplibrary 4005 might be renamed “European Vacation” as a descriptor of thecontent). In some embodiments, the media files corresponding to theseclips are stored in a file storage structure that mirrors the foldersshown in the clip library 4005.

Within the clip library 4005, some embodiments enable a user to performvarious clip management actions. These clip management actions mayinclude moving clips between events, creating new events, merging twoevents together, duplicating events (which, in some embodiments, createsa duplicate copy of the media to which the clips in the eventcorrespond), deleting events, etc. In addition, some embodiments allow auser to create sub-folders for an event. These sub-folders may includemedia clips filtered based on tags (e.g., keyword tags). For instance,in the “New Event 2-8-09” event, all media clips showing children mightbe tagged by the user with a “kids” keyword, and then these particularmedia clips could be displayed in a sub-folder of the event that filtersclips in this event to only display media clips tagged with the “kids”keyword.

The clip browser 4010 allows the user to view clips from a selectedfolder (e.g., an event, a sub-folder, etc.) of the clip library 4005. Asshown in this example, the folder “New Event 2-8-11 3” is selected inthe clip library 4005, and the clips belonging to that folder aredisplayed in the clip browser 4010. Some embodiments display the clipsas thumbnail filmstrips, as shown in this example. By moving a cursor(or a finger on a touchscreen) over one of the thumbnails (e.g., with amouse, a touchpad, a touchscreen, etc.), the user can skim through theclip. That is, when the user places the cursor at a particularhorizontal location within the thumbnail filmstrip, the media-editingapplication associates that horizontal location with a time in theassociated media file, and displays the image from the media file forthat time. In addition, the user can command the application to playback the media file in the thumbnail filmstrip.

In addition, the thumbnails for the clips in the browser display anaudio waveform underneath the clip that represents the audio of themedia file. In some embodiments, as a user skims through or plays backthe thumbnail filmstrip, the audio plays as well.

Many of the features of the clip browser are user-modifiable. Forinstance, in some embodiments, the user can modify one or more of thethumbnail size, the percentage of the thumbnail occupied by the audiowaveform, whether audio plays back when the user skims through the mediafiles, etc. In addition, some embodiments enable the user to view theclips in the clip browser in a list view. In this view, the clips arepresented as a list (e.g., with clip name, duration, etc.). Someembodiments also display a selected clip from the list in a filmstripview at the top of the browser so that the user can skim through orplayback the selected clip.

The timeline 4015 provides a visual representation of a compositepresentation (or project) being created by the user of the media-editingapplication. Specifically, it displays one or more geometric shapes thatrepresent one or more media clips that are part of the compositepresentation. The timeline 4015 of some embodiments includes a primarylane (also called a “spine”, “primary compositing lane”, or “centralcompositing lane”) as well as one or more secondary lanes (also called“anchor lanes”). The spine represents a primary sequence of media clipswhich, in some embodiments, does not have any gaps. The clips in theanchor lanes are anchored to a particular position along the spine (oralong a different anchor lane). Anchor lanes may be used for compositing(e.g., removing portions of one video and showing a different video inthose portions), B-roll cuts (i.e., cutting away from the primary videoto a different video whose clip is in the anchor lane), audio clips, orother composite presentation techniques.

The user can add media clips from the clip browser 4010 into thetimeline 4015 in order to add the clip to a presentation represented inthe timeline. Within the timeline, the user can perform further edits tothe media clips (e.g., move the clips around, split the clips, trim theclips, apply effects to the clips, etc.). The length (i.e., horizontalexpanse) of a clip in the timeline is a function of the length of mediarepresented by the clip. As the timeline is broken into increments oftime, a media clip occupies a particular length of time in the timeline.As shown, in some embodiments the clips within the timeline are shown asa series of images. The number of images displayed for a clip variesdepending on the length of the clip in the timeline, as well as the sizeof the clips (as the aspect ratio of each image will stay constant).

As with the clips in the clip browser, the user can skim through thetimeline or play back the timeline (either a portion of the timeline orthe entire timeline). In some embodiments, the playback (or skimming) isnot shown in the timeline clips, but rather in the preview display area4020.

The preview display area 4020 (also referred to as a “viewer”) displaysimages from media files that the user is skimming through, playing back,or editing. These images may be from a composite presentation in thetimeline 4015 or from a media clip in the clip browser 4010. In thisexample, the user has been skimming through the beginning of clip 4040,and therefore an image from the start of this media file is displayed inthe preview display area 4020. As shown, some embodiments will displaythe images as large as possible within the display area whilemaintaining the aspect ratio of the image.

The inspector display area 4025 displays detailed properties about aselected item and allows a user to modify some or all of theseproperties. The selected item might be a clip, a composite presentation,an effect, etc. In this case, the clip that is shown in the previewdisplay area 4020 is also selected, and thus the inspector displaysinformation about media clip 4040. This information includes duration,file format, file location, frame rate, date created, audio information,etc. about the selected media clip. In some embodiments, differentinformation is displayed depending on the type of item selected.

Some embodiments of the inspector display area 4025 also display variousdifferent tools for editing and modifying a selected item. For instance,some of these embodiments of the inspector display area 4025 display anadjustments panel (e.g., for activating color correction tools that areused for performing color correction operations) in the inspectordisplay area 4025.

The additional media display area 4030 displays various types ofadditional media, such as video effects, transitions, still images,titles, audio effects, standard audio clips, etc. In some embodiments,the set of effects is represented by a set of selectable UI items, eachselectable UI item representing a particular effect. In someembodiments, each selectable UI item also includes a thumbnail imagewith the particular effect applied. The display area 4030, in thisexample, is currently displaying a set of effects for the user to applyto a clip.

The toolbar 4035 includes various selectable items for editing,modifying what is displayed in one or more display areas, etc. The rightside of the toolbar includes various selectable items for modifying whattype of media is displayed in the additional media display area 4030.The illustrated toolbar 4035 includes items for video effects, visualtransitions between media clips, photos, titles, generators andbackgrounds, etc. In addition, the toolbar 4030 includes auser-selectable GUI item 4045 (e.g., an “Enhancements” button) forproviding a pull-down menu that includes a user-selectable option (notshown) for invoking the display of an adjustments panel (e.g., theadjustments panel 2220 illustrated in FIG. 22) in the inspector displayarea 4025. As shown, the toolbar 4035 also includes user-selectable GUIitem 4050 for providing a pull-down menu that includes user-selectableoptions (not shown) for invoking editing tools (e.g., trimming tools,blading tools, etc.).

The left side of the toolbar 4035 includes selectable items for mediamanagement and editing. Selectable items are provided for adding clipsfrom the clip browser 4010 to the timeline 4015. In some embodiments,different selectable items may be used to add a clip to the end of thespine, add a clip at a selected point in the spine (e.g., at thelocation of a playhead), add an anchored clip at the selected point,perform various trim operations on the media clips in the timeline, etc.The media management tools of some embodiments allow a user to markselected clips as favorites, among other options.

One or ordinary skill in the art will also recognize that the set ofdisplay areas shown in the GUI 4000 is one of many possibleconfigurations for the GUI of some embodiments. For instance, in someembodiments, the presence or absence of many of the display areas can betoggled through the GUI (e.g., the inspector display area 4025,additional media display area 4030, and clip library 4005). In addition,some embodiments allow the user to modify the size of the variousdisplay areas within the UI. For instance, when the additional mediadisplay area 4030 is removed, the timeline 4015 can increase in size toinclude that area. Similarly, the preview display area 4020 increases insize when the inspector display area 4025 is removed.

V. Software Architecture

In some embodiments, the processes described above are implemented assoftware running on a particular machine, such as a computer, a handhelddevice, or a tablet computing device, or stored in a machine readablemedium. FIG. 41 conceptually illustrates a software architecture of amedia-editing application 4100 of some embodiments. The media-editingapplication of some embodiments is a stand-alone application or isintegrated into another application (e.g., a compositing application),while in other embodiments the application might be implemented withinan operating system. Furthermore, in some embodiments, the applicationis provided as part of a server-based solution. In some suchembodiments, the application is provided via a thin client. That is, theapplication runs on a server while a user interacts with the applicationvia a separate machine remote from the server. In other suchembodiments, the application is provided as a thick client. That is, theapplication is distributed from the server to the client machine andruns on the client machine.

As shown, the media-editing application 4100 includes a user interface(UI) interaction module 4105, a set of editing modules 4115, a colormask manager 4120, a superellipsoid engine 4125, a superellipsoidsubtractor 4135, a color transition region engine 4130, a shape maskmanager 4140, a shape engine 4145, a shape transition region engine4150, and a rendering engine 4110. The media-editing application 4100also includes project data 4155 and source files 4160. In someembodiments, the source files 4160 store the media content (e.g., text,audio, image, and video content) data of media clips. The project data4155 stores data structures for composite presentations and media clipsas well as color masks, superellipsoid shapes, color transition regions,shape masks, shape transition regions, etc. that include references tomedia content data stored as mov, avi, jpg, png, mp3, wav, txt, etc.files in the source files 4160. In some embodiments, storages 4155 and4160 are all stored in one physical storage. In other embodiments, thestorages 4155 and 4160 are stored in separate storages. In some cases,for example, the source files 4160 may be stored across multiple harddrives, network drives, etc.

FIG. 41 also illustrates an operating system 4165 that includes inputdevice driver(s) 4170 and display module 4175. In some embodiments, asillustrated, the input device drivers 4170 and display module 4175 arepart of the operating system 4165 even when the media-editingapplication is an application separate from the operating system 4165.

The input device drivers 4170 may include drivers for translatingsignals from a keyboard, mouse, touchpad, drawing tablet, touch screen,etc. A user interacts with one or more of these input devices, whichsend signals to their corresponding device driver. The device driverthen translates the signals into user input data that is provided to theUI interaction module 4105.

The present application describes a graphical user interface thatprovides users with numerous ways to perform different sets ofoperations and functionalities. In some embodiments, these operationsand functionalities are performed based on different commands that arereceived from users through different input devices (e.g., keyboard,trackpad, touchpad, mouse, etc.). For example, the present applicationdescribes the use of a cursor in the graphical user interface to control(e.g., select, move) objects in the graphical user interface. However,in some embodiments, objects in the graphical user interface can also becontrolled or manipulated through other controls, such as touch control.In some embodiments, touch control is implemented through an inputdevice that can detect the presence and location of touch on a displayof the input device. An example of a device with such functionality is atouch screen device (e.g., as incorporated into a smart phone, a tabletcomputer, etc.). In some embodiments with touch control, a user directlymanipulates objects by interacting with the graphical user interfacethat is displayed on the display of the touch screen device. Forinstance, a user can select a particular object in the graphical userinterface by simply touching that particular object on the display ofthe touch screen device. As such, when touch control is utilized, acursor may not even be provided for enabling selection of an object of agraphical user interface in some embodiments. However, when a cursor isprovided in a graphical user interface, touch control can be used tocontrol the cursor in some embodiments.

The display module 4175 translates the output of a user interface for adisplay device. That is, the display module 4175 receives signals (e.g.,from the UI interaction module 4105) describing what should be displayedand translates these signals into pixel information that is sent to thedisplay device. The display device may be an LCD, a plasma screen, a CRTmonitor, a touch screen, etc.

The UI interaction module 4105 of the media-editing application 4100interprets the user input data received from the input device drivers4170 and passes it to various modules, including the color mask manager4120. The UI interaction module 4105 also manages the display of the UIand outputs this display information to the display module 4175. This UIdisplay information may be based on information from the color maskmanager 4120 or directly from input data (e.g., when a user moves anitem in the UI that does not affect any of the other modules of themedia-editing application 4100).

The color mask manager 4120 generates a color mask for an image (or aframe of a video clip) based on input that includes a selection of aportion of the image. The color mask manager 4120 may receive input fromthe UI interaction module 4105 (e.g., a set of pixels of the image)along with a request to create a color mask for the image. When thecolor mask manager 4120 receives such a request from the UI interactionmodule 4105, the color mask manager 4120 sends a request to thesuperellipsoid engine 4125 for a superellipsoid based on the input(e.g., the set of pixels of the image). When the color mask manager 4120receives the superellipsoid from the superellipsoid engine 4125, thecolor mask manager 4120 identifies a portion of the image that isincluded in the color mask based on the superellipsoid.

In addition, the color mask manager 4120 manages the color mask for theimage. For example, the color mask manager 4120 handles modifications(e.g., adding colors to the color mask or removing colors from the colormask) to the color mask. When the color mask manager 4120 receives fromthe UI interaction module 4105 input (e.g., a set of pixels of theimage) and a request to add colors to the color mask, the color maskmanager 4120 sends a request to the superellipsoid engine 4125 for asuperellipsoid that includes colors of the existing color mask andcolors to add to the existing color mask based on the input (e.g., theset of pixels of the image). When the color mask manager 4120 receivesthe superellipsoid from the superellipsoid engine 4125, the color maskmanager 4120 identifies a portion of the image that is included in thecolor mask based on the superellipsoid. When the color mask manager 4120receives from the UI interaction module 4105 input (e.g., a set ofpixels of the image) and a request to remove colors from the color mask,the color mask manager 4120 sends a request to the superellipsoidsubtractor 4135 for a superellipsoid that includes colors of theexisting color mask and excludes the colors to be removed from theexisting color mask based on the input (e.g., the set of pixels of theimage). When the color mask manager 4120 receives the superellipsoidfrom the superellipsoid subtractor 4135, the color mask manager 4120identifies a portion of the image that is included in the color maskbased on the superellipsoid.

Furthermore, the color mask manager 4120 manages a transition region fora color mask. When the color mask manager 4120 receives input (e.g., auser moves a slider control to create or adjust a transition region)from the UI interaction module 4105 to create or adjust a transitionregion for the color mask, the color mask manager 4120 sends to thecolor transition region engine 4130 the color mask and the input tocreate or adjust a transition region for the color mask. When the colormask manager 4120 receives the transition region from the colortransition region engine 4130, the color mask manager 4120 identifies aportion of the image that is included in the transition region of thecolor mask.

In addition, the color mask manager 4120 receives from the UIinteraction module 4105 edits (e.g., color correction operations) to theimage based on the color mask. In these cases, the color mask manager4120 sends the color mask and the edits to the image to the appropriateediting module in the set of editing modules 4115 for applying the editto the image based on the color mask. Also, the color mask manager 4120may access the project data 4155 and/or the source files 4160 in orderto perform some or all of the functions described above. For instance,the color mask manager 4120 might access the project data 4155 and/orthe source files 4160 in order to identify a portion of the image thatis included in the transition region of the color mask.

The superellipsoid engine 4125 generates a superellipsoid-based shape ina three-dimensional color space (e.g., a three-dimensional RGB colorspace) based on a set of colors (e.g., RGB component values of pixels ina selected portion of an image) in the three-dimensional color space.The superellipsoid engine 4125 may receive from the color mask manager4120 a request for a superellipsoid and the set of colors. In someembodiments, the superellipsoid engine 4125 performs PCA on the set ofcolors in the three-dimensional colors space in order to generate thesuperellipsoid-based shape. The superellipsoid engine 4125 may, in someinstances, access the project data 4155 and/or the source files 4160 inorder to generate the superellipsoid-based shape.

The color transition region engine 4130 is responsible for handling atransition region for a color mask. For instance, the color transitionregion engine 4130 receives from the color mask manager 4120 input(e.g., a user moves a slider control to create or adjust a transitionregion) to generate a transition region. When the color transitionregion engine 4130 receives from the color mask manager 4120 such input,the color transition region engine 4130 translates the input to anoffset amount. The color transition region engine 4130 sends a requestto the superellipsoid engine 4125 for a scaled version of thesuperellipsoid defined for the color mask based on the offset amount. Insome instances, the color transition region engine 4130 might access theproject data 4155 and/or the source files 4160 in order to generate thetransition region for the color mask.

The superellipsoid subtractor 4135 removes (i.e., subtracts) colors froma color mask. The superellipsoid subtractor 4135 of some embodimentsremoves colors form the color mask by generating a superellipsoid, whichis defined for the color mask, that excludes the colors to be removedfrom the color mask. In some of these embodiments, the superellipsoidsubtractor 4125 utilizes a collision detection technique (e.g., atriangle-triangle collision detection technique) to identify a boundingbox in a three-dimensional color space that includes the colorsoriginally in the color mask but excludes the colors to be removed fromthe color mask. The superellipsoid subtractor 4135 sends the identifiedbounding box to the superellipsoid engine 4125 for a superellipsoidbased on the identified bounding box. In some embodiments, thesuperellipsoid subtractor 4135 accesses the project data 4155 and/or thesource files 4160 in order to remove colors from a color mask.

The shape mask manager 4140 generates a shape mask for an image (or aframe of a video clip) based on input that includes a selection of auser-selectable UI item for creating (i.e., invoking) a shape mask. Someembodiments of the shape mask manager 4140 may receive from the UIinteraction module 4105 input to create the shape mask. In someembodiments, when the shape mask manager 4140 receives from the UIinteraction module 4105 input to create the shape mask, the shape maskmanager 4140 generates a shape mask (e.g., by creating a data structurethat defines the shape mask) and passes the shape mask to the UIinteraction module 4105 for the display module 4175 to translate andsend to a display device.

Further, the shape mask manager 4140 manages the shape mask for theimage. For instance, the shape mask manager 4140 handles modifications(e.g., move, adjust dimensions, scale, rotate, adjust curvature) to theshape of the shape mask. When the shape mask manager 4140 receives fromthe UI interaction module 4105 input (e.g., a set of pixels of theimage) to modify the shape of the shape mask, the shape mask manager4140 sends to the shape engine 4145 the shape of the shape mask and arequest to modify the shape of the shape mask. superellipsoid thatincludes colors of the existing color mask and colors to add to theexisting color mask based on the input (e.g., the set of pixels of theimage). When the color mask manager 4120 receives the superellipsoidfrom the superellipsoid engine 4125, the color mask manager 4120identifies a portion of the image that is included in the color maskbased on the superellipsoid. When the shape mask manager 4140 receivesfrom the shape engine 4145 the modified shape of the shape mask, theshape mask manager 4140 passes the shape mask to the UI interactionmodule 4105 for the display module 4175 to translate and send to adisplay device.

In addition, the shape mask manager 4140 manages a transition region fora shape mask. When the shape mask manager 4140 receives input (e.g.,when a user moves a user-adjustable shape mask control for adjusting thetransition region) from the UI interaction module 4105 to adjust thetransition region of the shape mask, the shape mask manager 4140 sendsto the shape transition region engine 4150 the shape mask and a requestto adjust the transition region for the shape mask. When the shape maskmanager 4140 receives the shape mask from the shape transition regionengine 4130, the color mask manager 4120 identifies a portion of theimage that is included in the transition region of the shape mask.

The color mask manager 4120 also receives from the UI interaction module4105 edits (e.g., color correction operations) to the image based on theshape mask. In these instances, the shape mask manager 4140 sends theshape mask and the edits to the image to the appropriate editing modulein the set of editing modules 4115 for applying the edit to the imagebased on the shape mask. Additionally, the shape mask manager 4140 mayaccess the project data 4155 and/or the source files 4160 in order toperform some or all of the functions described above. For example, theshape mask manager 4140 may access the project data 4155 and/or thesource files 4160 in order to identify a portion of the image that isincluded in the transition region of the shape mask.

The shape engine 4145 performs modifications to the shape of a shapemask. The modification to the shape of the shape mask may include movingthe shape of the shape mask, adjusting dimensions (e.g., x-dimension,y-dimension) of the shape of the shape mask, scaling the shape of theshape mask, rotating the shape of the shape mask, adjusting thecurvature of the shape of the shape mask). When the shape engine 4145receives from the shape mask manager 4140 a shape mask and a request tomodify the shape of the shape mask, the shape engine 4145 performs therequested modification to the shape of the shape mask and sends themodified shape mask to the shape mask manager 4140.

The shape transition region engine 4150 handles the transition regionfor a shape mask. For example, the shape transition region engine 4150receives from the shape mask manager 4150 input (e.g., a user moves ashape mask control to adjust the transition region of the shape mask) toadjust the transition region of the shape mask. When the shapetransition region engine 4150 receives from the shape mask manager 4140such input, the shape transition region engine 4150 sends a request tothe shape engine 4145 for a scaled version of the shape of the shapemask based on the input. In some cases, the shape transition regionengine 4150 may access the project data 4155 and/or the source files4160 in order to adjust the transition region for the shape mask.

The set of editing modules 4115 receives the various editing commands(e.g., through editing tools in the UI) for editing media clips. Asshown, the set of editing modules 4115 includes a roll module forrolling edit points of media clips, a ripple module for rippling editpoints of media clips, a slip module for slipping in and out points ofmedia clips, a slide module for sliding media clips that are in asequence, a razor module for cutting (i.e., splitting) media clips,along with other editing modules. Based on edits to media clips, the setof editing modules 4115 creates and modifies the project data 4155describing the affected media clips.

The rendering engine 4110 enables the storage or output of a compositemedia presentation from the media-editing application 4100. Therendering engine 4110 receives data from the editing modules 4115 and/orstorages 4155 and 4160 and, in some embodiments, creates a compositemedia presentation from the source files 4160. The composite mediapresentation can be stored in one of the illustrated storages or adifferent storage.

While many of the features have been described as being performed by onemodule (e.g., the superellipsoid engine 4125 or the color transitionregion engine 4130), one of ordinary skill in the art would recognizethat the functions might be split up into multiple modules. Similarly,the functions described as being performed by multiple different modulesmight be performed by a single module in some embodiments (e.g., thesuperellipsoid subtractor 4135 might be part of the superellipsoidengine 4125).

VI. Electronic System

Many of the above-described features and applications are implemented assoftware processes that are specified as a set of instructions recordedon a computer readable storage medium (also referred to as computerreadable medium). When these instructions are executed by one or morecomputational or processing unit(s) (e.g., one or more processors, coresof processors, or other processing units), they cause the processingunit(s) to perform the actions indicated in the instructions. Examplesof computer readable media include, but are not limited to, CD-ROMs,flash drives, random access memory (RAM) chips, hard drives, erasableprogrammable read only memories (EPROMs), electrically erasableprogrammable read-only memories (EEPROMs), etc. The computer readablemedia does not include carrier waves and electronic signals passingwirelessly or over wired connections.

In this specification, the term “software” is meant to include firmwareresiding in read-only memory or applications stored in magnetic storagewhich can be read into memory for processing by a processor. Also, insome embodiments, multiple software inventions can be implemented assub-parts of a larger program while remaining distinct softwareinventions. In some embodiments, multiple software inventions can alsobe implemented as separate programs. Finally, any combination ofseparate programs that together implement a software invention describedhere is within the scope of the invention. In some embodiments, thesoftware programs, when installed to operate on one or more electronicsystems, define one or more specific machine implementations thatexecute and perform the operations of the software programs.

FIG. 42 conceptually illustrates an electronic system 4200 with whichsome embodiments of the invention are implemented. The electronic system4200 may be a computer (e.g., a desktop computer, personal computer,tablet computer, etc.), phone, PDA, or any other sort of electronicdevice. Such an electronic system includes various types of computerreadable media and interfaces for various other types of computerreadable media. Electronic system 4200 includes a bus 4205, processingunit(s) 4210, a graphics processing unit (GPU) 4215, a system memory4220, a network 4225, a read-only memory 4230, a permanent storagedevice 4235, input devices 4240, and output devices 4245.

The bus 4205 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of theelectronic system 4200. For instance, the bus 4205 communicativelyconnects the processing unit(s) 4210 with the read-only memory 4230, theGPU 4215, the system memory 4220, and the permanent storage device 4235.

From these various memory units, the processing unit(s) 4210 retrievesinstructions to execute and data to process in order to execute theprocesses of the invention. The processing unit(s) may be a singleprocessor or a multi-core processor in different embodiments. Someinstructions are passed to and executed by the GPU 4215. The GPU 4215can offload various computations or complement the image processingprovided by the processing unit(s) 4210. In some embodiments, suchfunctionality can be provided using CoreImage's kernel shading language.

The read-only-memory (ROM) 4230 stores static data and instructions thatare needed by the processing unit(s) 4210 and other modules of theelectronic system. The permanent storage device 4235, on the other hand,is a read-and-write memory device. This device is a non-volatile memoryunit that stores instructions and data even when the electronic system4200 is off. Some embodiments of the invention use a mass-storage device(such as a magnetic or optical disk and its corresponding disk drive) asthe permanent storage device 4235.

Other embodiments use a removable storage device (such as a floppy disk,flash memory device, etc., and its corresponding disk drive) as thepermanent storage device. Like the permanent storage device 4235, thesystem memory 4220 is a read-and-write memory device. However, unlikestorage device 4235, the system memory 4220 is a volatile read-and-writememory, such a random access memory. The system memory 4220 stores someof the instructions and data that the processor needs at runtime. Insome embodiments, the invention's processes are stored in the systemmemory 4220, the permanent storage device 4235, and/or the read-onlymemory 4230. For example, the various memory units include instructionsfor processing multimedia clips in accordance with some embodiments.From these various memory units, the processing unit(s) 4210 retrievesinstructions to execute and data to process in order to execute theprocesses of some embodiments.

The bus 4205 also connects to the input and output devices 4240 and4245. The input devices 4240 enable the user to communicate informationand select commands to the electronic system. The input devices 4240include alphanumeric keyboards and pointing devices (also called “cursorcontrol devices”), cameras (e.g., webcams), microphones or similardevices for receiving voice commands, etc. The output devices 4245display images generated by the electronic system or otherwise outputdata. The output devices 4245 include printers and display devices, suchas cathode ray tubes (CRT) or liquid crystal displays (LCD), as well asspeakers or similar audio output devices. Some embodiments includedevices such as a touchscreen that function as both input and outputdevices.

Finally, as shown in FIG. 42, bus 4205 also couples electronic system4200 to a network 4225 through a network adapter (not shown). In thismanner, the computer can be a part of a network of computers (such as alocal area network (“LAN”), a wide area network (“WAN”), or an Intranet,or a network of networks, such as the Internet. Any or all components ofelectronic system 4200 may be used in conjunction with the invention.

Some embodiments include electronic components, such as microprocessors,storage and memory that store computer program instructions in amachine-readable or computer-readable medium (alternatively referred toas computer-readable storage media, machine-readable media, ormachine-readable storage media). Some examples of such computer-readablemedia include RAM, ROM, read-only compact discs (CD-ROM), recordablecompact discs (CD-R), rewritable compact discs (CD-RW), read-onlydigital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a varietyof recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.),flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.),magnetic and/or solid state hard drives, read-only and recordableBlu-Ray® discs, ultra density optical discs, any other optical ormagnetic media, and floppy disks. The computer-readable media may storea computer program that is executable by at least one processing unitand includes sets of instructions for performing various operations.Examples of computer programs or computer code include machine code,such as is produced by a compiler, and files including higher-level codethat are executed by a computer, an electronic component, or amicroprocessor using an interpreter.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, some embodiments areperformed by one or more integrated circuits, such as applicationspecific integrated circuits (ASICs) or field programmable gate arrays(FPGAs). In some embodiments, such integrated circuits executeinstructions that are stored on the circuit itself. In addition, someembodiments execute software stored in programmable logic devices(PLDs), ROM, or RAM devices.

As used in this specification and any claims of this application, theterms “computer”, “server”, “processor”, and “memory” all refer toelectronic or other technological devices. These terms exclude people orgroups of people. For the purposes of the specification, the termsdisplay or displaying means displaying on an electronic device. As usedin this specification and any claims of this application, the terms“computer readable medium,” “computer readable media,” and “machinereadable medium” are entirely restricted to tangible, physical objectsthat store information in a form that is readable by a computer. Theseterms exclude any wireless signals, wired download signals, and anyother ephemeral signals.

While the invention has been described with reference to numerousspecific details, one of ordinary skill in the art will recognize thatthe invention can be embodied in other specific forms without departingfrom the spirit of the invention. In addition, a number of the figures(including FIGS. 7, 11, 12, 16, and 19) conceptually illustrateprocesses. The specific operations of these processes may not beperformed in the exact order shown and described. The specificoperations may not be performed in one continuous series of operations,and different specific operations may be performed in differentembodiments. Furthermore, the process could be implemented using severalsub-processes, or as part of a larger macro process. Thus, one ofordinary skill in the art would understand that the invention is not tobe limited by the foregoing illustrative details, but rather is to bedefined by the appended claims.

We claim:
 1. A non transitory machine readable medium storing a programwhich when executed by at least one processing unit provides a graphicaluser interface (GUI), the GUI comprising: a display area for displayingan image comprising a plurality of pixels, each pixel comprising a setof pixel values in a three dimensional color space; a first selectableGUI item for activating a color masking tool for selecting a set ofpixels in the image, defining a rectangular cuboid to encompass thepixel values of the set of pixels in the three dimensional color space,and defining a three dimensional volume within the rectangular cuboidthat encompasses the pixel values of the set of pixels, wherein thethree dimensional volume has at least one rounded corner in order tocreate a tighter fit around the pixel values of the set of pixels; and asecond selectable GUI item for applying a color correction operation tothe image by modifying pixels in the image that have pixel valuesencompassed by the three dimensional volume in the three dimensionalcolor space.
 2. The non transitory machine readable medium of claim 1,wherein each corner of the three dimensional volume is a rounded corner.3. The non transitory machine readable medium of claim 1, wherein thethree dimensional volume is a superellipsoid.
 4. The non transitorymachine readable medium of claim 1, wherein the set of pixels is a firstset of pixels, the rectangular cuboid is a first rectangular cuboid, andthe three dimensional volume is a first three dimensional volume,wherein the color masking tool is further for selecting a second set ofpixels in the image, defining a second rectangular cuboid to encompassthe pixel values of the second set of pixels in the three dimensionalcolor space, and defining a second three dimensional volume within thesecond rectangular cuboid that encompasses the pixel values of thesecond set of pixels, wherein the second three dimensional volume has atleast one rounded corner in order to create a tighter fit around thepixel values of the set of pixels.
 5. The non transitory machinereadable medium of claim 4, wherein the second selectable GUI item isfurther for applying the color correction operation to the image bymodifying pixels in the image that have pixel values encompassed by thesecond three dimensional volume in the three dimensional color space. 6.The non transitory machine readable medium of claim 4, wherein thesecond set of pixels includes at least one pixel in the first set ofpixels.
 7. The non transitory machine readable medium of claim 4,wherein the second set of pixels in the image includes at least onepixel in the image that has pixel values that are encompassed by thefirst three dimensional volume.
 8. The non transitory machine readablemedium of claim 1, wherein the color masking tool is a first colormasking tool, the set of pixels is a first set of pixels, and the threedimensional volume is a first three dimensional volume, wherein the GUIfurther comprises a third selectable GUI item for activating a secondcolor masking tool for selecting a second set of pixels in the image anddefining a second three dimensional volume to encompass the pixel valuesof the second set of pixels in the three dimensional color space, thesecond three dimensional volume having at least one rounded corner andserving as an approximation of a rectangular cuboid.
 9. The nontransitory machine readable medium of claim 1, wherein the image is astill image.
 10. The non transitory machine readable medium of claim 1,wherein the image is a frame of a video clip.
 11. The non transitorymachine readable medium of claim 1, wherein the three dimensional colorspace is an RGB color space.
 12. The non transitory machine readablemedium of claim 11, wherein the set of pixel values comprises a redcomponent value, a green component value, and a blue component value.13. The non transitory machine readable medium of claim 1, wherein theset of pixels in the image is a first set of pixels, wherein the GUIfurther comprises a third selectable GUI item for invoking a shapemasking tool comprising an adjustable mask for display in the displayarea and a set of selectable GUI items for adjusting the adjustablemask.
 14. The non transitory machine readable medium of claim 13,wherein the adjustable mask is a rectangle with rounded corners.
 15. Thenon transitory machine readable medium of claim 13, wherein theadjustable mask is a superellipse.
 16. A method of providing a graphicaluser interface (GUI), the method comprising: providing a display areafor displaying an image comprising a plurality of pixels, each pixelcomprising a set of pixel values in a three dimensional color space;providing a first selectable GUI item for activating a color maskingtool for selecting a set of pixels in the image, defining a rectangularcuboid to encompass the pixel values of the set of pixels in the threedimensional color space, and defining a three dimensional volume withinthe rectangular cuboid that encompasses the pixel values of the set ofpixels, wherein the three dimensional volume has at least one roundedcorner in order to create a tighter fit around the pixel values of theset of pixels; and providing a second selectable GUI item for applying acolor correction operation to the image by modifying pixels in the imagethat have pixel values encompassed by the three dimensional volume inthe three dimensional color space.
 17. The method of claim 16, whereineach corner of the three dimensional volume is a rounded corner.
 18. Themethod of claim 16, wherein the three dimensional volume is asuperellipsoid.
 19. The method of claim 16, wherein the set of pixels isa first set of pixels, the rectangular cuboid is a first rectangularcuboid, and the three dimensional volume is a first three dimensionalvolume, wherein the color masking tool is further for selecting a secondset of pixels in the image, defining a second rectangular cuboid toencompass the pixel values of the second set of pixels in the threedimensional color space, and defining a second three dimensional volumewithin the second rectangular cuboid that encompasses the pixel valuesof the second set of pixels, wherein the second three dimensional volumehas at least one rounded corner in order to create a tighter fit aroundthe pixel values of the set of pixels.
 20. The method claim 19, whereinthe second selectable GUI item is further for applying the colorcorrection operation to the image by modifying pixels in the image thathave pixel values encompassed by the second three dimensional volume inthe three dimensional color space.
 21. The method of claim 16, whereinthe color masking tool is a first color masking tool, the set of pixelsis a first set of pixels, and the three dimensional volume is a firstthree dimensional volume, wherein the method further comprises providinga third selectable GUI item for activating a second color masking toolfor selecting a second set of pixels in the image and defining a secondthree dimensional volume to encompass the pixel values of the second setof pixels in the three dimensional color space, the second threedimensional volume having at least one rounded corner and serving as anapproximation of a rectangular cuboid.
 22. A method of providing userinterface (GUI), the method comprising: providing a display area fordisplaying an image comprising a plurality of pixels, each pixelcomprising a set of pixel values in a three dimensional color space;providing a first selectable GUI item for activating a color maskingtool for: selecting a first set of pixels and a second set of pixels inthe image; defining a first three dimensional volume to encompass pixelvalues of the first set of pixels in the three dimensional color spaceand a second three dimensional volume to encompass pixels values of thesecond set of pixels in the three dimensional color space, the first andsecond three dimensional volumes each having at least one rounded cornerand serving as approximations of rectangular cuboids; identifying aportion of the first three dimensional volume in the three dimensionalcolor space that does not collide with the second three dimensionalvolume in the three dimensional color space; and determining a thirdthree dimensional volume in the three-dimensional color space thatincludes the identified portion of the first three dimensional volume inthe three dimensional color space; and providing a third selectable GUIitem for applying a color correction operation to the image by modifyingpixels in the image that have pixel values encompassed by the thirdthree dimensional volume in the three dimensional color space.
 23. Themethod of claim 22, wherein the first, second, and third threedimensional volumes are superellipsoids.
 24. A method of providing agraphical user interface (GUI), the method comprising: providing adisplay area for displaying an image comprising a plurality of pixels,each pixel comprising a set of pixel values in a three dimensional colorspace; providing a first selectable GUI item for activating a colormasking tool for (1) selecting a set of pixels in the image and defininga first three dimensional volume, serving as an approximation of arectangular cuboid having at least one rounded corner, to encompasspixel values of the set of pixels in the three dimensional color space,wherein pixels in the image that have pixel values included in the firstthree dimensional volume are fully selected, and (2) identifying, in thethree dimensional color space, a second three dimensional volume thatdefines a transition region about the first three dimensional volume,wherein each point of the surface of the second three dimensional volumeis within an offset distance from at least one point on the surface ofthe first three dimensional volume, wherein pixels in the image thathave pixel values included in the defined transition region arepartially selected; and providing a second selectable GUI item forapplying a color correction operation to the image by modifying pixelsin the image that have pixel values encompassed by the three dimensionalvolumes in the three dimensional color space, wherein the secondselectable GUI item applies the color correction operation to the imageby fully applying the color correction operation to pixels in the imagethat are fully selected and partially applying the color correctionoperation to pixels in the image that are partially selected.
 25. Themethod of claim 24, wherein the first and second three dimensionalvolumes in the three dimensional color space are superellipsoids. 26.The method of claim 24, wherein the first and second three dimensionalvolumes in the three dimensional color space are non-spherical shapes.